diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitor.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitor.ps1 index 30011a49b215..6bbd14913b44 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitor.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitor.ps1 @@ -145,8 +145,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorAppService.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorAppService.ps1 index 73fe7464aa83..c0df823cd49e 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorAppService.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorAppService.ps1 @@ -114,8 +114,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorHost.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorHost.ps1 index 018022587d7b..389dfb838696 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorHost.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorHost.ps1 @@ -114,8 +114,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorLinkableEnv.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorLinkableEnv.ps1 index 8091b714b647..e2292136a4e0 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorLinkableEnv.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorLinkableEnv.ps1 @@ -144,8 +144,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMarketplaceSaaSResourceDetail.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMarketplaceSaaSResourceDetail.ps1 index 15eb64c5b25c..4fe47bd79a25 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMarketplaceSaaSResourceDetail.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMarketplaceSaaSResourceDetail.ps1 @@ -134,8 +134,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMetricStatus.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMetricStatus.ps1 index 86b567f40689..d0de21269620 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMetricStatus.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorMetricStatus.ps1 @@ -177,8 +177,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSOConfig.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSOConfig.ps1 index fa5cae7c7d20..8cea1765b2ec 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSOConfig.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSOConfig.ps1 @@ -152,8 +152,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSODetail.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSODetail.ps1 index c30c0e619a84..bead013f279e 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSODetail.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorSSODetail.ps1 @@ -132,8 +132,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorTagRule.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorTagRule.ps1 index a1ff942690b7..4e963f5e16d7 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorTagRule.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorTagRule.ps1 @@ -153,8 +153,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorVMHostPayload.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorVMHostPayload.ps1 index f17ed4cd7b8f..2cb3f81f51ea 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorVMHostPayload.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitorVMHostPayload.ps1 @@ -114,8 +114,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredResource.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredResource.ps1 index 6ceb26f99bea..85ddd0831def 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredResource.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredResource.ps1 @@ -148,8 +148,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredSubscription.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredSubscription.ps1 index 045afbaaa032..d47a1231b477 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredSubscription.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Get-AzDynatraceMonitoredSubscription.ps1 @@ -162,8 +162,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Invoke-AzDynatraceManageMonitorAgentInstallation.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Invoke-AzDynatraceManageMonitorAgentInstallation.ps1 index 18dd3e4083d3..b769265e8e56 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Invoke-AzDynatraceManageMonitorAgentInstallation.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Invoke-AzDynatraceManageMonitorAgentInstallation.ps1 @@ -232,8 +232,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitor.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitor.ps1 index 20726bb858c1..1ac4529929bf 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitor.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitor.ps1 @@ -318,8 +318,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorSSOConfig.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorSSOConfig.ps1 index 9632d21ba3f4..13fb444510fe 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorSSOConfig.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorSSOConfig.ps1 @@ -195,8 +195,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorTagRule.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorTagRule.ps1 index 29e89d5ad5e9..ccb58d33ec52 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorTagRule.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitorTagRule.ps1 @@ -230,8 +230,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitoredSubscription.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitoredSubscription.ps1 index 7dbc58b2eb21..2f7c7a57b9be 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitoredSubscription.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/New-AzDynatraceMonitoredSubscription.ps1 @@ -215,8 +215,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/ProxyCmdletDefinitions.ps1 index 1c3b0f834063..e9cdb3b17efe 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -114,8 +114,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -332,8 +331,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -567,8 +565,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -753,8 +750,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -967,8 +963,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1173,8 +1168,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1423,8 +1417,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1650,8 +1643,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1857,8 +1849,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2082,8 +2073,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2271,8 +2261,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2486,8 +2475,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2791,8 +2779,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3081,8 +3068,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3348,8 +3334,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3654,8 +3639,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4048,8 +4032,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4290,8 +4273,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4531,8 +4513,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4762,8 +4743,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5097,8 +5077,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5360,8 +5339,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5656,8 +5634,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5942,8 +5919,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitor.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitor.ps1 index c1b5bdd7fdc1..d672961df50f 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitor.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitor.ps1 @@ -156,8 +156,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitorTagRule.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitorTagRule.ps1 index af62d37039b4..5d06faac6795 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitorTagRule.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitorTagRule.ps1 @@ -170,8 +170,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitoredSubscription.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitoredSubscription.ps1 index 5bbcdfa50305..01c1e4864eb5 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitoredSubscription.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Remove-AzDynatraceMonitoredSubscription.ps1 @@ -170,8 +170,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitor.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitor.ps1 index 72fbca7ed962..083958efba3b 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitor.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitor.ps1 @@ -211,8 +211,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorPlan.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorPlan.ps1 index 15fb59a4c8f1..337058979681 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorPlan.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorPlan.ps1 @@ -264,8 +264,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorSSOConfig.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorSSOConfig.ps1 index 5765c7eddc3c..ba12d5734ed4 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorSSOConfig.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorSSOConfig.ps1 @@ -188,8 +188,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorTagRule.ps1 b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorTagRule.ps1 index 6225c066759a..55fd07066656 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorTagRule.ps1 +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/exports/Update-AzDynatraceMonitorTagRule.ps1 @@ -221,8 +221,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/DynatraceObservability/DynatraceObservability.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/DynatraceObservability/DynatraceObservability.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index dab030d0fd3d..f221d60ab1f6 100644 --- a/generated/DynatraceObservability/DynatraceObservability.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/DynatraceObservability/DynatraceObservability.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Add-AzEdgeActionAttachment.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Add-AzEdgeActionAttachment.ps1 index 4fe5fdc2a17b..965e84ca87b5 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Add-AzEdgeActionAttachment.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Add-AzEdgeActionAttachment.ps1 @@ -189,8 +189,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Deploy-AzEdgeActionVersionCode.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Deploy-AzEdgeActionVersionCode.ps1 index 49afeb168186..322f21f94aef 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Deploy-AzEdgeActionVersionCode.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Deploy-AzEdgeActionVersionCode.ps1 @@ -158,8 +158,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeAction.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeAction.ps1 index 29782cf23b7b..6937ec654848 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeAction.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeAction.ps1 @@ -140,8 +140,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionExecutionFilter.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionExecutionFilter.ps1 index 0fbe78c702e2..472fe1a7a973 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionExecutionFilter.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionExecutionFilter.ps1 @@ -160,8 +160,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersion.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersion.ps1 index f854cd4f2a6c..d41dfb3c5fb1 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersion.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersion.ps1 @@ -160,8 +160,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersionCode.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersionCode.ps1 index b71832e6c78c..128fe98a59ea 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersionCode.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Get-AzEdgeActionVersionCode.ps1 @@ -181,8 +181,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeAction.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeAction.ps1 index add8fac2b1e0..aaed76ff972f 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeAction.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeAction.ps1 @@ -166,8 +166,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionExecutionFilter.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionExecutionFilter.ps1 index 411bcd003f13..b3e67a7b3e26 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionExecutionFilter.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionExecutionFilter.ps1 @@ -223,8 +223,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionVersion.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionVersion.ps1 index 55c84f8d2f21..a5ed211f777f 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionVersion.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/New-AzEdgeActionVersion.ps1 @@ -219,8 +219,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/ProxyCmdletDefinitions.ps1 index 7eeaa3568bc6..b66965560fd8 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -189,8 +189,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -424,8 +423,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -678,8 +676,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -911,8 +908,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1124,8 +1120,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1420,8 +1415,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1713,8 +1707,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1953,8 +1946,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2220,8 +2212,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2468,8 +2459,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2713,8 +2703,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2938,8 +2927,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3182,8 +3170,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3467,8 +3454,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3754,8 +3740,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4016,8 +4001,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4247,8 +4231,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeAction.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeAction.ps1 index 5b39801164b2..a1c38cc089b3 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeAction.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeAction.ps1 @@ -153,8 +153,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionAttachment.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionAttachment.ps1 index 5402f5d6784e..d4b9da692c9c 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionAttachment.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionAttachment.ps1 @@ -195,8 +195,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionExecutionFilter.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionExecutionFilter.ps1 index e601df28e816..42cd5efb5c0e 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionExecutionFilter.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionExecutionFilter.ps1 @@ -173,8 +173,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionVersion.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionVersion.ps1 index 944268605c4c..a13c69e8947e 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionVersion.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Remove-AzEdgeActionVersion.ps1 @@ -173,8 +173,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Switch-AzEdgeActionVersionDefault.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Switch-AzEdgeActionVersionDefault.ps1 index 27f690b579b7..469d3b101b1f 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Switch-AzEdgeActionVersionDefault.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Switch-AzEdgeActionVersionDefault.ps1 @@ -173,8 +173,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeAction.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeAction.ps1 index d9b2b7e91ee3..7b69f30baf73 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeAction.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeAction.ps1 @@ -187,8 +187,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionExecutionFilter.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionExecutionFilter.ps1 index 6a3f1601968d..d76c5bd10303 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionExecutionFilter.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionExecutionFilter.ps1 @@ -213,8 +213,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionVersion.ps1 b/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionVersion.ps1 index 622db72d8757..7a17b95fced1 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionVersion.ps1 +++ b/generated/EdgeAction/EdgeAction.Autorest/exports/Update-AzEdgeActionVersion.ps1 @@ -212,8 +212,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/EdgeAction/EdgeAction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/EdgeAction/EdgeAction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index acfe32191bea..fcac5d536ad3 100644 --- a/generated/EdgeAction/EdgeAction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/EdgeAction/EdgeAction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/ActionGroup.Autorest/exports/Enable-AzActionGroupReceiver.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/Enable-AzActionGroupReceiver.ps1 index f12f4e8934bd..f4f7e746cfbd 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/Enable-AzActionGroupReceiver.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/Enable-AzActionGroupReceiver.ps1 @@ -167,8 +167,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/exports/Get-AzActionGroup.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/Get-AzActionGroup.ps1 index c34979870f13..02509a1c9213 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/Get-AzActionGroup.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/Get-AzActionGroup.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/exports/New-AzActionGroup.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/New-AzActionGroup.ps1 index e0b810d15075..492ba005ba38 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/New-AzActionGroup.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/New-AzActionGroup.ps1 @@ -346,8 +346,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 index 553ccdfdc889..a6e48fe0759b 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -167,8 +167,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -378,8 +377,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -797,8 +795,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1009,8 +1006,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1387,8 +1383,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3044,8 +3039,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/exports/Remove-AzActionGroup.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/Remove-AzActionGroup.ps1 index 6e1962b33acc..f05a1367f72f 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/Remove-AzActionGroup.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/Remove-AzActionGroup.ps1 @@ -139,8 +139,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/exports/Test-AzActionGroup.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/Test-AzActionGroup.ps1 index 54d9efd9811f..3956972a9202 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/Test-AzActionGroup.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/Test-AzActionGroup.ps1 @@ -160,8 +160,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/exports/Update-AzActionGroup.ps1 b/generated/Monitor/ActionGroup.Autorest/exports/Update-AzActionGroup.ps1 index bcdd442cfe86..51f5230b2b21 100644 --- a/generated/Monitor/ActionGroup.Autorest/exports/Update-AzActionGroup.ps1 +++ b/generated/Monitor/ActionGroup.Autorest/exports/Update-AzActionGroup.ps1 @@ -307,8 +307,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActionGroup.Autorest/generated/Module.cs b/generated/Monitor/ActionGroup.Autorest/generated/Module.cs index 75c6f2fb7c99..c68b75ac6418 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/Module.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/Module.cs @@ -68,7 +68,7 @@ public partial class Module public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.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.ActionGroup"; + public string Name => @"Az.Monitor"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -80,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.ActionGroup"; + public string ResourceId => @"Az.Monitor"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs index ecf011b3f0f3..22878da65d0a 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableExpanded.cs @@ -501,7 +501,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs index 92cc41ed24bb..6b894461928a 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaIdentityExpanded.cs @@ -482,7 +482,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs index e1c6a02462fa..63ec228c6d81 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonFilePath.cs @@ -503,7 +503,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs index aa214c4e926e..efd906e88382 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/EnableAzActionGroupReceiver_EnableViaJsonString.cs @@ -501,7 +501,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_Delete.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_Delete.cs index ae365b2fff22..26ac5e4c8d25 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_Delete.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_Delete.cs @@ -495,7 +495,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -519,7 +519,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_DeleteViaIdentity.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_DeleteViaIdentity.cs index 87381ba6850c..3715b55750a0 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_DeleteViaIdentity.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/RemoveAzActionGroup_DeleteViaIdentity.cs @@ -475,7 +475,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -499,7 +499,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateExpanded.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateExpanded.cs index 6366b5ecbb8f..ebe3575c5c15 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateExpanded.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateExpanded.cs @@ -41,18 +41,9 @@ public partial class TestAzActionGroup_CreateExpanded : global::System.Managemen /// 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; - /// The request body which contain contact detail metadata private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.INotificationRequestBody _notificationRequestBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.NotificationRequestBody(); - /// - /// 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; - /// Backing field for property. private string _actionGroupName; @@ -400,11 +391,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets.TestAzActi /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -720,24 +706,7 @@ public TestAzActionGroup_CreateExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ITestNotificationDetailsResponse 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaIdentityExpanded.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaIdentityExpanded.cs index 75dd49a0c478..477d1f1d94bb 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaIdentityExpanded.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaIdentityExpanded.cs @@ -41,18 +41,9 @@ public partial class TestAzActionGroup_CreateViaIdentityExpanded : global::Syste /// 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; - /// The request body which contain contact detail metadata private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.INotificationRequestBody _notificationRequestBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.NotificationRequestBody(); - /// - /// 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; - /// /// The value of the supported alert type. Supported alert type values are: servicehealth, metricstaticthreshold, metricsdynamicthreshold, /// logalertv2, smartalert, webtestalert, logalertv1numresult, logalertv1metricmeasurement, resourcehealth, activitylog, actualcostbudget, @@ -358,11 +349,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets.TestAzActi /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -698,24 +684,7 @@ public TestAzActionGroup_CreateViaIdentityExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ITestNotificationDetailsResponse 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonFilePath.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonFilePath.cs index 97df505faf98..4e99b9cea773 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonFilePath.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonFilePath.cs @@ -42,17 +42,8 @@ public partial class TestAzActionGroup_CreateViaJsonFilePath : global::System.Ma /// 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; - /// Backing field for property. private string _actionGroupName; @@ -263,11 +254,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets.TestAzActi /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -583,24 +569,7 @@ public TestAzActionGroup_CreateViaJsonFilePath() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ITestNotificationDetailsResponse 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonString.cs b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonString.cs index 764b318acb9a..06de57a9666e 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonString.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/cmdlets/TestAzActionGroup_CreateViaJsonString.cs @@ -42,15 +42,6 @@ public partial class TestAzActionGroup_CreateViaJsonString : global::System.Mana /// 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; - /// Backing field for property. private string _actionGroupName; @@ -261,11 +252,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Cmdlets.TestAzActi /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -581,24 +567,7 @@ public TestAzActionGroup_CreateViaJsonString() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ITestNotificationDetailsResponse 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index ddfbd85214f7..e7df1778e4d6 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/ActionGroup.Autorest/generated/runtime/Context.cs b/generated/Monitor/ActionGroup.Autorest/generated/runtime/Context.cs index 4ad4b0ef09c7..407e5205d481 100644 --- a/generated/Monitor/ActionGroup.Autorest/generated/runtime/Context.cs +++ b/generated/Monitor/ActionGroup.Autorest/generated/runtime/Context.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Runtime /// The IContext Interface defines the communication mechanism for input customization. /// /// - /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. /// public interface IContext { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 index eaf378a45897..1a3db524b02c 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Get-AzActivityLogAlert.ps1 @@ -139,8 +139,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 index 289bb75a27b3..7117e0786e30 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/New-AzActivityLogAlert.ps1 @@ -203,8 +203,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 index cccc27603ef3..fcd70f5e849e 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -139,8 +139,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -353,8 +352,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -627,8 +625,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1253,8 +1250,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 index de7b1bc0f9e5..ca6e57739081 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Remove-AzActivityLogAlert.ps1 @@ -141,8 +141,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 b/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 index a6f0457401c7..ed8228c6ae60 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 +++ b/generated/Monitor/ActivityLogAlert.Autorest/exports/Update-AzActivityLogAlert.ps1 @@ -171,8 +171,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 2ecc57b4d607..17ff50837a26 100644 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 index d1651977b103..e0ea31aaf6bc 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscalePredictiveMetric.ps1 @@ -165,8 +165,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 index 984d33f5063a..7d21538f5455 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Get-AzAutoscaleSetting.ps1 @@ -139,8 +139,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 index bcd67535f487..f5d377826655 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/New-AzAutoscaleSetting.ps1 @@ -249,8 +249,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 index f6b987f50b94..24c529ad1657 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -165,8 +165,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -375,8 +374,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -697,8 +695,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -907,8 +904,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2059,8 +2055,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 index 9905f5bd8f38..04889cc6fe42 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Remove-AzAutoscaleSetting.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 b/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 index ae9ddbcae8e7..c4321239a4d4 100644 --- a/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 +++ b/generated/Monitor/Autoscale.Autorest/exports/Update-AzAutoscaleSetting.ps1 @@ -235,8 +235,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 7b7f12f17799..0fe2eb91213a 100644 --- a/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/Autoscale.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionEndpoint.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionEndpoint.ps1 index e30eb76b14b2..003740ca7795 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionEndpoint.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionEndpoint.ps1 @@ -143,8 +143,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRule.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRule.ps1 index 9c8882b99c95..c0c7d4257b8a 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRule.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRule.ps1 @@ -143,8 +143,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRuleAssociation.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRuleAssociation.ps1 index 38648bc009ab..0cbbe8b13a54 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRuleAssociation.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Get-AzDataCollectionRuleAssociation.ps1 @@ -168,8 +168,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionEndpoint.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionEndpoint.ps1 index 455e779fcbcb..6b1c5a5ab2a1 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionEndpoint.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionEndpoint.ps1 @@ -192,8 +192,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRule.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRule.ps1 index 92011717e3da..f47d4954f495 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRule.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRule.ps1 @@ -482,8 +482,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRuleAssociation.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRuleAssociation.ps1 index 03b25f5e6da0..3d62499e20d4 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRuleAssociation.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/New-AzDataCollectionRuleAssociation.ps1 @@ -141,8 +141,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/ProxyCmdletDefinitions.ps1 index 6d17206086d5..d86a0291bc90 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -143,8 +143,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -384,8 +383,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -601,8 +599,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -866,8 +863,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1079,8 +1075,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1626,8 +1621,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1840,8 +1834,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2046,8 +2039,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2252,8 +2244,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2507,8 +2498,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2728,8 +2718,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3210,8 +3199,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionEndpoint.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionEndpoint.ps1 index 6243b7e1bd6e..975de42a631c 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionEndpoint.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionEndpoint.ps1 @@ -142,8 +142,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRule.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRule.ps1 index 7c0a847564ea..186d64c644d7 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRule.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRule.ps1 @@ -142,8 +142,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRuleAssociation.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRuleAssociation.ps1 index 0fe9812c2f9c..9fa2834d32d0 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRuleAssociation.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Remove-AzDataCollectionRuleAssociation.ps1 @@ -135,8 +135,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionEndpoint.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionEndpoint.ps1 index 87460f0a1277..81586bff698f 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionEndpoint.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionEndpoint.ps1 @@ -184,8 +184,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRule.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRule.ps1 index 2a0700ba214d..b2714163223d 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRule.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRule.ps1 @@ -418,8 +418,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRuleAssociation.ps1 b/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRuleAssociation.ps1 index 4bb18e001cbf..00345b91172c 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRuleAssociation.ps1 +++ b/generated/Monitor/DataCollectionRule.Autorest/exports/Update-AzDataCollectionRuleAssociation.ps1 @@ -150,8 +150,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/Module.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/Module.cs index d6a515e71231..826e3f0e6720 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/Module.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/Module.cs @@ -68,7 +68,7 @@ public partial class Module public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.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.DataCollectionRule"; + public string Name => @"Az.Monitor"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -80,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.DataCollectionRule"; + public string ResourceId => @"Az.Monitor"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_Delete.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_Delete.cs index 658257c10a9c..58de4ff0b9eb 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_Delete.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_Delete.cs @@ -495,7 +495,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -519,7 +519,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_DeleteViaIdentity.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_DeleteViaIdentity.cs index 300c025b006c..aa8e3b14f32c 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_DeleteViaIdentity.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionEndpoint_DeleteViaIdentity.cs @@ -475,7 +475,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -499,7 +499,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_Delete.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_Delete.cs index 6f1e4e14dba6..378a63b17b0d 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_Delete.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_Delete.cs @@ -477,7 +477,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -501,7 +501,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_DeleteViaIdentity.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_DeleteViaIdentity.cs index c025af216896..33139c2d3cb9 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_DeleteViaIdentity.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRuleAssociation_DeleteViaIdentity.cs @@ -471,7 +471,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -495,7 +495,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_Delete.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_Delete.cs index ae2d91ebb8c6..e23eaa255e86 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_Delete.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_Delete.cs @@ -495,7 +495,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -519,7 +519,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_DeleteViaIdentity.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_DeleteViaIdentity.cs index a6340bbdf74c..7fa836e60b46 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_DeleteViaIdentity.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/cmdlets/RemoveAzDataCollectionRule_DeleteViaIdentity.cs @@ -475,7 +475,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -499,7 +499,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 188fe1d33c98..5af3fcf0cd8e 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/Context.cs b/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/Context.cs index a4f5f45eadd3..4098fd1a9ddb 100644 --- a/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/Context.cs +++ b/generated/Monitor/DataCollectionRule.Autorest/generated/runtime/Context.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.DataCollection.Runtime /// The IContext Interface defines the communication mechanism for input customization. /// /// - /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. /// public interface IContext { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs b/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs index fe75862408b6..ea1dd81fa6a1 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/Properties/AssemblyInfo.cs @@ -23,4 +23,4 @@ [assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] [assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] -[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 index 894a1b3e8379..1b66ee36dd7e 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSetting.ps1 @@ -128,8 +128,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 index 20c1b040c7af..415d0a395337 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzDiagnosticSettingCategory.ps1 @@ -125,8 +125,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 index bbf2f21534b8..22dc26f298eb 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzEventCategory.ps1 @@ -95,8 +95,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 index 0b1f917cebea..c6bb815f3171 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Get-AzSubscriptionDiagnosticSetting.ps1 @@ -127,8 +127,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 index ff59d3db481a..d501020ca7a0 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzDiagnosticSetting.ps1 @@ -208,8 +208,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 index 51e423926b73..c3753e1cbb40 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/New-AzSubscriptionDiagnosticSetting.ps1 @@ -176,8 +176,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 index 8bca398ab92f..1bc17a9240e3 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -125,8 +125,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -318,8 +317,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -478,8 +476,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -668,8 +665,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -948,8 +944,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1189,8 +1184,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1391,8 +1385,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1585,8 +1578,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1856,8 +1848,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2096,8 +2087,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 index d1fb99a116bb..50bed1adfb5a 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzDiagnosticSetting.ps1 @@ -130,8 +130,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 index d8c6dc3ab622..2f8ab90e390f 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Remove-AzSubscriptionDiagnosticSetting.ps1 @@ -130,8 +130,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 index b228034e193a..db4dc7e0c45a 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzDiagnosticSetting.ps1 @@ -200,8 +200,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 index d1ef3665f3bc..da8b1e5a1591 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 +++ b/generated/Monitor/DiagnosticSetting.Autorest/exports/Update-AzSubscriptionDiagnosticSetting.ps1 @@ -176,8 +176,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 426eab1372bc..52783ccdff79 100644 --- a/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/DiagnosticSetting.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/Metricdata.Autorest/Properties/AssemblyInfo.cs b/generated/Monitor/Metricdata.Autorest/Properties/AssemblyInfo.cs index d3991ca7839a..2e1ec8d7606e 100644 --- a/generated/Monitor/Metricdata.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Monitor/Metricdata.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Metricdata")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] -[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/Monitor/Metricdata.Autorest/exports/Get-AzMetricsBatch.ps1 b/generated/Monitor/Metricdata.Autorest/exports/Get-AzMetricsBatch.ps1 index 54239c509490..231e2f7b9050 100644 --- a/generated/Monitor/Metricdata.Autorest/exports/Get-AzMetricsBatch.ps1 +++ b/generated/Monitor/Metricdata.Autorest/exports/Get-AzMetricsBatch.ps1 @@ -224,8 +224,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Metricdata.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/Metricdata.Autorest/exports/ProxyCmdletDefinitions.ps1 index 54239c509490..231e2f7b9050 100644 --- a/generated/Monitor/Metricdata.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/Metricdata.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -224,8 +224,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/Metricdata.Autorest/generated/Module.cs b/generated/Monitor/Metricdata.Autorest/generated/Module.cs index 7192a377e054..75378f811d6a 100644 --- a/generated/Monitor/Metricdata.Autorest/generated/Module.cs +++ b/generated/Monitor/Metricdata.Autorest/generated/Module.cs @@ -68,7 +68,7 @@ public partial class Module public static Microsoft.Azure.PowerShell.Cmdlets.Metric.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.Metricdata"; + public string Name => @"Az.Monitor"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -80,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.Metricdata"; + public string ResourceId => @"Az.Monitor"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } diff --git a/generated/Monitor/Metricdata.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/Metricdata.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 6141b372b047..86f123e43bd0 100644 --- a/generated/Monitor/Metricdata.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/Metricdata.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/Metricdata.Autorest/generated/runtime/Context.cs b/generated/Monitor/Metricdata.Autorest/generated/runtime/Context.cs index 0fbaf5c3ad44..bbef033ad647 100644 --- a/generated/Monitor/Metricdata.Autorest/generated/runtime/Context.cs +++ b/generated/Monitor/Metricdata.Autorest/generated/runtime/Context.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Metric.Runtime /// The IContext Interface defines the communication mechanism for input customization. /// /// - /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. /// public interface IContext { diff --git a/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.format.ps1xml b/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.format.ps1xml index 2c34e4da0215..26066104f189 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.format.ps1xml +++ b/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.format.ps1xml @@ -2,33 +2,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.MonitorWorkspaceIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspace - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.MonitorWorkspaceIdentity + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspace#Multiple - + - + - + - AzureMonitorWorkspaceName + AccountId - ResourceGroupName + ProvisioningState - SubscriptionId + PublicNetworkAccess @@ -36,32 +36,82 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettings#Multiple - + - + + + + + + + DataCollectionEndpointResourceId + + + DataCollectionRuleResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetrics + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetrics#Multiple + + + - + - + + + + + + + InternalId + + + PrometheusQueryEndpoint + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource#Multiple + + + - + - + - + + + + + + + @@ -71,22 +121,16 @@ Name - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType + Location - SystemDataLastModifiedAt + ProvisioningState - SystemDataLastModifiedBy + PublicNetworkAccess - SystemDataLastModifiedByType + ResourceGroupName @@ -94,27 +138,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionProperties + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTags#Multiple - - - - + - GroupId - - - ProvisioningState + Item @@ -122,33 +160,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceListResult - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceListResult#Multiple - - - - - - - + - ActionsRequired - - - Description - - - Status + NextLink @@ -156,21 +182,57 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.Resource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.Resource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceProperties#Multiple - + + + + + + + + + + + + + + + + + + + - Name + AccountId + + + DefaultIngestionSettingDataCollectionEndpointResourceId + + + DefaultIngestionSettingDataCollectionRuleResourceId + + + MetricInternalId + + + MetricPrometheusQueryEndpoint + + + ProvisioningState + + + PublicNetworkAccess @@ -178,9 +240,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetail - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetail#Multiple @@ -212,39 +274,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.Operation + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IngestionSettings - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.Operation + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IngestionSettings#Multiple - - - - - - - + - + - ActionType - - - IsDataAction - - - Name + DataCollectionEndpointResourceId - Origin + DataCollectionRuleResourceId @@ -252,39 +302,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Metrics - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Metrics#Multiple - - - - - - - + - + - Description - - - Operation - - - Provider + InternalId - Resource + PrometheusQueryEndpoint @@ -292,21 +330,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.MonitorWorkspaceIdentity - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.MonitorWorkspaceIdentity#Multiple - + + + + + + + - NextLink + AzureMonitorWorkspaceName + + + ResourceGroupName + + + SubscriptionId @@ -314,73 +364,101 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ResourceAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ResourceAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Operation#Multiple + + + + + + + + + + + ActionType + + + IsDataAction + Name + + Origin + - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemData + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemData + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationDisplay#Multiple - - - - - - - + - + - + - + - CreatedAt - - - CreatedBy + Description - CreatedByType + Operation - LastModifiedAt + Provider - LastModifiedBy + Resource + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationListResult + + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationListResult#Multiple + + + + + + + + + + - LastModifiedByType + NextLink @@ -388,9 +466,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnection#Multiple @@ -415,9 +493,6 @@ - - - @@ -443,30 +518,27 @@ SystemDataLastModifiedByType - - Location - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionProperties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTags + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionProperties#Multiple - + - Item + ProvisioningState @@ -474,33 +546,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionState#Multiple - + - + - + - AccountId + ActionsRequired - ProvisioningState + Description - PublicNetworkAccess + Status @@ -508,27 +580,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceDefaultIngestionSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceDefaultIngestionSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Resource#Multiple - - - - + - DataCollectionEndpointResourceId - - - DataCollectionRuleResourceId + Name @@ -536,27 +602,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceMetrics + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ResourceAutoGenerated - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceMetrics + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ResourceAutoGenerated#Multiple - - - - + - InternalId - - - PrometheusQueryEndpoint + Name @@ -564,67 +624,51 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemData#Multiple - + - + - + - + - + + + + - Name + CreatedAt - Location + CreatedBy - ProvisioningState + CreatedByType - PublicNetworkAccess + LastModifiedAt - ResourceGroupName + LastModifiedBy - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTags - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTags - - - - - - - - - - - Item + LastModifiedByType @@ -632,107 +676,63 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceListResult + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResource - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceListResult + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResource#Multiple - + - - - - - - NextLink - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceProperties - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceProperties - - - - + - + - + - + - + - + - + - AccountId - - - DefaultIngestionSettingDataCollectionEndpointResourceId + Name - DefaultIngestionSettingDataCollectionRuleResourceId + SystemDataCreatedAt - MetricInternalId + SystemDataCreatedBy - MetricPrometheusQueryEndpoint + SystemDataCreatedByType - ProvisioningState + SystemDataLastModifiedAt - PublicNetworkAccess + SystemDataLastModifiedBy - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings - - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings - - - - - - - - - - - - - - DataCollectionEndpointResourceId + SystemDataLastModifiedByType - DataCollectionRuleResourceId + Location @@ -740,27 +740,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTags#Multiple - - - - + - InternalId - - - PrometheusQueryEndpoint + Item diff --git a/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.psd1 b/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.psd1 index 5b5a9413621a..e2782fd57fc2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.psd1 +++ b/generated/Monitor/MonitorWorkspace.Autorest/Az.MonitorWorkspace.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.MonitorWorkspace.private.dll' FormatsToProcess = './Az.MonitorWorkspace.format.ps1xml' - FunctionsToExport = 'Get-AzMonitorWorkspace', 'New-AzMonitorWorkspace', 'Remove-AzMonitorWorkspace', 'Update-AzMonitorWorkspace', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzMonitorWorkspace', 'New-AzMonitorWorkspace', 'Remove-AzMonitorWorkspace', 'Update-AzMonitorWorkspace' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'MonitorWorkspace' diff --git a/generated/Monitor/MonitorWorkspace.Autorest/check-dependencies.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/check-dependencies.ps1 +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/exports/Get-AzMonitorWorkspace.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/exports/Get-AzMonitorWorkspace.ps1 index 36da837e3dd3..7feba2cd2eff 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/exports/Get-AzMonitorWorkspace.ps1 +++ b/generated/Monitor/MonitorWorkspace.Autorest/exports/Get-AzMonitorWorkspace.ps1 @@ -29,7 +29,7 @@ Get-AzMonitorWorkspace -ResourceGroupName azps_test_group -Name azps-monitor-wor .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azmonitorworkspace #> function Get-AzMonitorWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -76,7 +76,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -136,6 +135,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -159,9 +166,7 @@ begin { List = 'Az.MonitorWorkspace.private\Get-AzMonitorWorkspace_List'; List1 = 'Az.MonitorWorkspace.private\Get-AzMonitorWorkspace_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.Monitor.MonitorWorkspace.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 { @@ -175,6 +180,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/Monitor/MonitorWorkspace.Autorest/exports/New-AzMonitorWorkspace.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/exports/New-AzMonitorWorkspace.ps1 index e0edb1cd10a2..5760949b7886 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/exports/New-AzMonitorWorkspace.ps1 +++ b/generated/Monitor/MonitorWorkspace.Autorest/exports/New-AzMonitorWorkspace.ps1 @@ -16,16 +16,16 @@ <# .Synopsis -Create or update a workspace +Create a workspace .Description -Create or update a workspace +Create a workspace .Example New-AzMonitorWorkspace -Name azps-monitor-workspace -ResourceGroupName azps_test_group -Location eastus .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource .Notes COMPLEX PARAMETER PROPERTIES @@ -40,10 +40,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/new-azmonitorworkspace #> function New-AzMonitorWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('AzureMonitorWorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] @@ -52,6 +54,8 @@ param( ${Name}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] # The name of the resource group. @@ -59,6 +63,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -69,22 +75,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -142,6 +161,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -162,10 +189,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateExpanded'; CreateViaIdentityExpanded = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 { @@ -179,6 +206,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/Monitor/MonitorWorkspace.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/exports/ProxyCmdletDefinitions.ps1 index d3f259acdb9d..c90511123cf9 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/MonitorWorkspace.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -29,7 +29,7 @@ Get-AzMonitorWorkspace -ResourceGroupName azps_test_group -Name azps-monitor-wor .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/get-azmonitorworkspace #> function Get-AzMonitorWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -76,7 +76,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -136,6 +135,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -159,9 +166,7 @@ begin { List = 'Az.MonitorWorkspace.private\Get-AzMonitorWorkspace_List'; List1 = 'Az.MonitorWorkspace.private\Get-AzMonitorWorkspace_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.Monitor.MonitorWorkspace.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 { @@ -175,6 +180,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) @@ -220,16 +228,16 @@ end { <# .Synopsis -Create or update a workspace +Create a workspace .Description -Create or update a workspace +Create a workspace .Example New-AzMonitorWorkspace -Name azps-monitor-workspace -ResourceGroupName azps_test_group -Location eastus .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource .Notes COMPLEX PARAMETER PROPERTIES @@ -244,10 +252,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/new-azmonitorworkspace #> function New-AzMonitorWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Alias('AzureMonitorWorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] @@ -256,6 +266,8 @@ param( ${Name}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] # The name of the resource group. @@ -263,6 +275,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -273,22 +287,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -346,6 +373,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -366,10 +401,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateExpanded'; CreateViaIdentityExpanded = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateViaIdentityExpanded'; + CreateViaJsonFilePath = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MonitorWorkspace.private\New-AzMonitorWorkspace_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 { @@ -383,6 +418,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) @@ -483,7 +521,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -561,6 +598,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -582,9 +627,7 @@ begin { Delete = 'Az.MonitorWorkspace.private\Remove-AzMonitorWorkspace_Delete'; DeleteViaIdentity = 'Az.MonitorWorkspace.private\Remove-AzMonitorWorkspace_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 { @@ -598,6 +641,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) @@ -643,9 +689,9 @@ end { <# .Synopsis -Updates part of a workspace +Update part of a workspace .Description -Updates part of a workspace +Update part of a workspace .Example Update-AzMonitorWorkspace -Name azps-monitor-workspace -ResourceGroupName azps_test_group -Tag @{"123"="abc"} .Example @@ -654,7 +700,7 @@ Get-AzMonitorWorkspace -Name azps-monitor-workspace -ResourceGroupName azps_test .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource .Notes COMPLEX PARAMETER PROPERTIES @@ -669,10 +715,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azmonitorworkspace #> function Update-AzMonitorWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('AzureMonitorWorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] @@ -681,6 +729,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] # The name of the resource group. @@ -688,6 +738,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -698,16 +750,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -765,6 +829,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -785,10 +857,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 { @@ -802,6 +874,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/Monitor/MonitorWorkspace.Autorest/exports/Remove-AzMonitorWorkspace.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/exports/Remove-AzMonitorWorkspace.ps1 index 8bdd5ecd289d..145c1dd1df8d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/exports/Remove-AzMonitorWorkspace.ps1 +++ b/generated/Monitor/MonitorWorkspace.Autorest/exports/Remove-AzMonitorWorkspace.ps1 @@ -71,7 +71,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -149,6 +148,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -170,9 +177,7 @@ begin { Delete = 'Az.MonitorWorkspace.private\Remove-AzMonitorWorkspace_Delete'; DeleteViaIdentity = 'Az.MonitorWorkspace.private\Remove-AzMonitorWorkspace_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 { @@ -186,6 +191,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/Monitor/MonitorWorkspace.Autorest/exports/Update-AzMonitorWorkspace.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/exports/Update-AzMonitorWorkspace.ps1 index 82451dec4043..ad2142b8dba0 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/exports/Update-AzMonitorWorkspace.ps1 +++ b/generated/Monitor/MonitorWorkspace.Autorest/exports/Update-AzMonitorWorkspace.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Updates part of a workspace +Update part of a workspace .Description -Updates part of a workspace +Update part of a workspace .Example Update-AzMonitorWorkspace -Name azps-monitor-workspace -ResourceGroupName azps_test_group -Tag @{"123"="abc"} .Example @@ -27,7 +27,7 @@ Get-AzMonitorWorkspace -Name azps-monitor-workspace -ResourceGroupName azps_test .Inputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource +Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource .Notes COMPLEX PARAMETER PROPERTIES @@ -42,10 +42,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.monitor/update-azmonitorworkspace #> function Update-AzMonitorWorkspace { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('AzureMonitorWorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] @@ -54,6 +56,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [System.String] # The name of the resource group. @@ -61,6 +65,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -71,16 +77,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMonitorWorkspaceIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -138,6 +156,14 @@ begin { } $parameterSet = $PSCmdlet.ParameterSetName + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." + } + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } @@ -158,10 +184,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MonitorWorkspace.private\Update-AzMonitorWorkspace_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 { @@ -175,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/Monitor/MonitorWorkspace.Autorest/generated/Module.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/Module.cs index c4b61ac1d22d..a9e1ca1afbed 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/Module.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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,14 +64,11 @@ 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.Monitor.MonitorWorkspace.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.MonitorWorkspace"; + public string Name => @"Az.Monitor"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -75,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.MonitorWorkspace"; + public string ResourceId => @"Az.Monitor"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpP /// 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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.PowerShell.cs index c87bb1ffb20b..952f31de4382 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.cs index 243e4b039f6d..82186ad636ce 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.json.cs index b35b985adb72..1e6e2035afd8 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.PowerShell.cs deleted file mode 100644 index cdbe2b50be35..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.PowerShell.cs +++ /dev/null @@ -1,350 +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.Monitor.MonitorWorkspace.Models.Api20230403 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; - - /// An Azure Monitor Workspace definition - [System.ComponentModel.TypeConverter(typeof(AzureMonitorWorkspaceResourceTypeConverter))] - public partial class AzureMonitorWorkspaceResource - { - - /// - /// 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 AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.MetricsTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("DefaultIngestionSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).AccountId, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("MetricInternalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId, global::System.Convert.ToString); - } - if (content.Contains("MetricPrometheusQueryEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); - } - if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); - } - if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, 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 AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Metric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.MetricsTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("DefaultIngestionSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).AccountId, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpointConnection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccess")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess.CreateFrom); - } - if (content.Contains("MetricInternalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId, global::System.Convert.ToString); - } - if (content.Contains("MetricPrometheusQueryEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); - } - if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); - } - if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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(); - } - } - /// An Azure Monitor Workspace definition - [System.ComponentModel.TypeConverter(typeof(AzureMonitorWorkspaceResourceTypeConverter))] - public partial interface IAzureMonitorWorkspaceResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.cs deleted file mode 100644 index 8d895b0cb0ec..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.cs +++ /dev/null @@ -1,127 +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.Monitor.MonitorWorkspace.Models.Api20230403 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; - - /// Resource properties - public partial class AzureMonitorWorkspaceResourceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourcePropertiesInternal, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace __azureMonitorWorkspace = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace(); - - /// The immutable ID of the Azure Monitor workspace. This property is read-only. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).AccountId; } - - /// The Data Collection Rule and Endpoint used for ingestion by default. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings DefaultIngestionSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting; } - - /// - /// The Azure resource Id of the default data collection endpoint for this workspace. - /// - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionEndpointResourceId; } - - /// The Azure resource Id of the default data collection rule for this workspace. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionRuleResourceId; } - - /// Information about metrics for the Azure Monitor workspace - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric; } - - /// An internal identifier for the metrics container. Only to be used by the system - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricInternalId; } - - /// The Prometheus query endpoint for the workspace - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricPrometheusQueryEndpoint; } - - /// Internal Acessors for AccountId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).AccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).AccountId = value; } - - /// Internal Acessors for DefaultIngestionSetting - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.DefaultIngestionSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting = value; } - - /// Internal Acessors for DefaultIngestionSettingDataCollectionEndpointResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionEndpointResourceId = value; } - - /// Internal Acessors for DefaultIngestionSettingDataCollectionRuleResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionRuleResourceId = value; } - - /// Internal Acessors for Metric - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric = value; } - - /// Internal Acessors for MetricInternalId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricInternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricInternalId = value; } - - /// Internal Acessors for MetricPrometheusQueryEndpoint - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricPrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricPrometheusQueryEndpoint = value; } - - /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PrivateEndpointConnection = value; } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).ProvisioningState = value; } - - /// Internal Acessors for PublicNetworkAccess - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PublicNetworkAccess = value; } - - /// List of private endpoint connections - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PrivateEndpointConnection; } - - /// - /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).ProvisioningState; } - - /// Gets or sets allow or disallow public network access to workspace - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PublicNetworkAccess; } - - /// Creates an new instance. - public AzureMonitorWorkspaceResourceProperties() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__azureMonitorWorkspace), __azureMonitorWorkspace); - await eventListener.AssertObjectIsValid(nameof(__azureMonitorWorkspace), __azureMonitorWorkspace); - } - } - /// Resource properties - public partial interface IAzureMonitorWorkspaceResourceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace - { - - } - /// Resource properties - internal partial interface IAzureMonitorWorkspaceResourcePropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.PowerShell.cs deleted file mode 100644 index c30314977340..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.PowerShell.cs +++ /dev/null @@ -1,310 +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.Monitor.MonitorWorkspace.Models.Api40 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; - - /// The private endpoint connection resource. - [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] - public partial class PrivateEndpointConnection - { - - /// - /// 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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointTypeConverter.ConvertFrom); - } - if (content.Contains("PrivateLinkServiceConnectionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); - } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); - } - if (content.Contains("PrivateEndpointId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("PrivateEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointTypeConverter.ConvertFrom); - } - if (content.Contains("PrivateLinkServiceConnectionState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); - } - if (content.Contains("GroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); - } - if (content.Contains("PrivateEndpointId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); - } - if (content.Contains("PrivateLinkServiceConnectionStateStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); - } - 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.Monitor.MonitorWorkspace.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(); - } - } - /// The private endpoint connection resource. - [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] - public partial interface IPrivateEndpointConnection - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.PowerShell.cs similarity index 53% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.PowerShell.cs index fc9b10de2388..83cee43b5cf5 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspace 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,49 +78,49 @@ internal AzureMonitorWorkspace(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.MetricsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetricsTypeConverter.ConvertFrom); } if (content.Contains("DefaultIngestionSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettingsTypeConverter.ConvertFrom); } if (content.Contains("AccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } if (content.Contains("MetricInternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); } if (content.Contains("MetricPrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, 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. @@ -135,71 +135,69 @@ internal AzureMonitorWorkspace(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.MetricsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetricsTypeConverter.ConvertFrom); } if (content.Contains("DefaultIngestionSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettingsTypeConverter.ConvertFrom); } if (content.Contains("AccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); } if (content.Contains("MetricInternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); } if (content.Contains("MetricPrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspace(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspace(content); } @@ -209,7 +207,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.TypeConverter.cs index e339424e6efc..1a229fb7c69b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.cs similarity index 63% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.cs index ca3c3b4da3d6..5c820de26df3 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Properties of an Azure Monitor workspace public partial class AzureMonitorWorkspace : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal { /// Backing field for property. @@ -21,89 +21,89 @@ public partial class AzureMonitorWorkspace : public string AccountId { get => this._accountId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings _defaultIngestionSetting; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings _defaultIngestionSetting; /// The Data Collection Rule and Endpoint used for ingestion by default. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings DefaultIngestionSetting { get => (this._defaultIngestionSetting = this._defaultIngestionSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings DefaultIngestionSetting { get => (this._defaultIngestionSetting = this._defaultIngestionSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettings()); } /// /// The Azure resource Id of the default data collection endpoint for this workspace. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionEndpointResourceId; } + public string DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionEndpointResourceId; } /// The Azure resource Id of the default data collection rule for this workspace. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionRuleResourceId; } + public string DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionRuleResourceId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics _metric; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics _metric; /// Information about metrics for the Azure Monitor workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Metric { get => (this._metric = this._metric ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Metric { get => (this._metric = this._metric ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetrics()); } /// An internal identifier for the metrics container. Only to be used by the system [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)Metric).InternalId; } + public string MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)Metric).InternalId; } /// The Prometheus query endpoint for the workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)Metric).PrometheusQueryEndpoint; } + public string MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)Metric).PrometheusQueryEndpoint; } /// Internal Acessors for AccountId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.AccountId { get => this._accountId; set { {_accountId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.AccountId { get => this._accountId; set { {_accountId = value;} } } /// Internal Acessors for DefaultIngestionSetting - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.DefaultIngestionSetting { get => (this._defaultIngestionSetting = this._defaultIngestionSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings()); set { {_defaultIngestionSetting = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.DefaultIngestionSetting { get => (this._defaultIngestionSetting = this._defaultIngestionSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettings()); set { {_defaultIngestionSetting = value;} } } /// Internal Acessors for DefaultIngestionSettingDataCollectionEndpointResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionEndpointResourceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionEndpointResourceId = value ?? null; } /// Internal Acessors for DefaultIngestionSettingDataCollectionRuleResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionRuleResourceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)DefaultIngestionSetting).DataCollectionRuleResourceId = value ?? null; } /// Internal Acessors for Metric - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.Metric { get => (this._metric = this._metric ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics()); set { {_metric = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.Metric { get => (this._metric = this._metric ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetrics()); set { {_metric = value;} } } /// Internal Acessors for MetricInternalId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)Metric).InternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)Metric).InternalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)Metric).InternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)Metric).InternalId = value ?? null; } /// Internal Acessors for MetricPrometheusQueryEndpoint - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)Metric).PrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)Metric).PrometheusQueryEndpoint = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)Metric).PrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)Metric).PrometheusQueryEndpoint = value ?? null; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for PublicNetworkAccess - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal.PublicNetworkAccess { get => this._publicNetworkAccess; set { {_publicNetworkAccess = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.PublicNetworkAccess { get => this._publicNetworkAccess; set { {_publicNetworkAccess = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] _privateEndpointConnection; + private System.Collections.Generic.List _privateEndpointConnection; /// List of private endpoint connections [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => this._privateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? _publicNetworkAccess; + private string _publicNetworkAccess; /// Gets or sets allow or disallow public network access to workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; } + public string PublicNetworkAccess { get => this._publicNetworkAccess; } /// Creates an new instance. public AzureMonitorWorkspace() @@ -119,6 +119,9 @@ public partial interface IAzureMonitorWorkspace : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The immutable ID of the Azure Monitor workspace. This property is read-only.", SerializedName = @"accountId", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +132,9 @@ public partial interface IAzureMonitorWorkspace : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Azure resource Id of the default data collection endpoint for this workspace.", SerializedName = @"dataCollectionEndpointResourceId", PossibleTypes = new [] { typeof(string) })] @@ -137,6 +143,9 @@ public partial interface IAzureMonitorWorkspace : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Azure resource Id of the default data collection rule for this workspace.", SerializedName = @"dataCollectionRuleResourceId", PossibleTypes = new [] { typeof(string) })] @@ -145,6 +154,9 @@ public partial interface IAzureMonitorWorkspace : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"An internal identifier for the metrics container. Only to be used by the system", SerializedName = @"internalId", PossibleTypes = new [] { typeof(string) })] @@ -153,6 +165,9 @@ public partial interface IAzureMonitorWorkspace : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Prometheus query endpoint for the workspace", SerializedName = @"prometheusQueryEndpoint", PossibleTypes = new [] { typeof(string) })] @@ -161,28 +176,39 @@ public partial interface IAzureMonitorWorkspace : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of private endpoint connections", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Creating", "Succeeded", "Deleting", "Failed", "Canceled")] + string ProvisioningState { get; } /// Gets or sets allow or disallow public network access to workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets or sets allow or disallow public network access to workspace", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; } } /// Properties of an Azure Monitor workspace @@ -192,7 +218,7 @@ internal partial interface IAzureMonitorWorkspaceInternal /// The immutable ID of the Azure Monitor workspace. This property is read-only. string AccountId { get; set; } /// The Data Collection Rule and Endpoint used for ingestion by default. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings DefaultIngestionSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings DefaultIngestionSetting { get; set; } /// /// The Azure resource Id of the default data collection endpoint for this workspace. /// @@ -200,19 +226,21 @@ internal partial interface IAzureMonitorWorkspaceInternal /// The Azure resource Id of the default data collection rule for this workspace. string DefaultIngestionSettingDataCollectionRuleResourceId { get; set; } /// Information about metrics for the Azure Monitor workspace - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Metric { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Metric { get; set; } /// An internal identifier for the metrics container. Only to be used by the system string MetricInternalId { get; set; } /// The Prometheus query endpoint for the workspace string MetricPrometheusQueryEndpoint { get; set; } /// List of private endpoint connections - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Creating", "Succeeded", "Deleting", "Failed", "Canceled")] + string ProvisioningState { get; set; } /// Gets or sets allow or disallow public network access to workspace - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.json.cs similarity index 89% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.json.cs index a7e8840a1baa..5936e578d654 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspace.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,23 +65,23 @@ internal AzureMonitorWorkspace(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Monito { return; } - {_metric = If( json?.PropertyT("metrics"), out var __jsonMetrics) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics.FromJson(__jsonMetrics) : Metric;} - {_defaultIngestionSetting = If( json?.PropertyT("defaultIngestionSettings"), out var __jsonDefaultIngestionSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings.FromJson(__jsonDefaultIngestionSettings) : DefaultIngestionSetting;} - {_accountId = If( json?.PropertyT("accountId"), out var __jsonAccountId) ? (string)__jsonAccountId : (string)AccountId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} - {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_metric = If( json?.PropertyT("metrics"), out var __jsonMetrics) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetrics.FromJson(__jsonMetrics) : _metric;} + {_defaultIngestionSetting = If( json?.PropertyT("defaultIngestionSettings"), out var __jsonDefaultIngestionSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettings.FromJson(__jsonDefaultIngestionSettings) : _defaultIngestionSetting;} + {_accountId = If( json?.PropertyT("accountId"), out var __jsonAccountId) ? (string)__jsonAccountId : (string)_accountId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnection.FromJson(__u) )) ))() : null : _privateEndpointConnection;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)_publicNetworkAccess;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspace(json) : null; } @@ -105,23 +105,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._metric ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._metric.ToJson(null,serializationMode) : null, "metrics" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._defaultIngestionSetting ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._defaultIngestionSetting.ToJson(null,serializationMode) : null, "defaultIngestionSettings" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._accountId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._accountId.ToString()) : null, "accountId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { if (null != this._privateEndpointConnection) { @@ -133,7 +133,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. container.Add("privateEndpointConnections",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.PowerShell.cs similarity index 77% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.PowerShell.cs index 0aa0929f8667..d7dc4cb98fba 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspaceDefaultIngestionSettings 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 AzureMonitorWorkspaceDefaultIngestionSettings(global::System.Collection // actually deserialize if (content.Contains("DataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, 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 AzureMonitorWorkspaceDefaultIngestionSettings(global::System.Management // actually deserialize if (content.Contains("DataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspaceDefaultIngestionSettings(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspaceDefaultIngestionSettings(content); } @@ -148,7 +148,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.TypeConverter.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.TypeConverter.cs index 7eb9308def62..46b4a533b84d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.cs similarity index 70% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.cs index 7f9c1143dc6b..8da88a792aae 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.cs @@ -3,37 +3,37 @@ // 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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// The Data Collection Rule and Endpoint used for ingestion by default. public partial class AzureMonitorWorkspaceDefaultIngestionSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettingsInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettingsInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings __ingestionSettings = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings __ingestionSettings = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IngestionSettings(); /// /// The Azure resource Id of the default data collection endpoint for this workspace. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string DataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)__ingestionSettings).DataCollectionEndpointResourceId; } + public string DataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)__ingestionSettings).DataCollectionEndpointResourceId; } /// The Azure resource Id of the default data collection rule for this workspace. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string DataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)__ingestionSettings).DataCollectionRuleResourceId; } + public string DataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)__ingestionSettings).DataCollectionRuleResourceId; } /// Internal Acessors for DataCollectionEndpointResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal.DataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)__ingestionSettings).DataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)__ingestionSettings).DataCollectionEndpointResourceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal.DataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)__ingestionSettings).DataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)__ingestionSettings).DataCollectionEndpointResourceId = value ?? null; } /// Internal Acessors for DataCollectionRuleResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal.DataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)__ingestionSettings).DataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)__ingestionSettings).DataCollectionRuleResourceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal.DataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)__ingestionSettings).DataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)__ingestionSettings).DataCollectionRuleResourceId = value ?? null; } /// /// Creates an new instance. @@ -58,13 +58,13 @@ public AzureMonitorWorkspaceDefaultIngestionSettings() /// The Data Collection Rule and Endpoint used for ingestion by default. public partial interface IAzureMonitorWorkspaceDefaultIngestionSettings : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings { } /// The Data Collection Rule and Endpoint used for ingestion by default. internal partial interface IAzureMonitorWorkspaceDefaultIngestionSettingsInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal { } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.json.cs index ce5bf1746ed2..dd5a72b40dd6 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceDefaultIngestionSettings.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceDefaultIngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -66,18 +66,18 @@ internal AzureMonitorWorkspaceDefaultIngestionSettings(Microsoft.Azure.PowerShel { return; } - __ingestionSettings = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettings(json); + __ingestionSettings = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IngestionSettings(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceDefaultIngestionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceDefaultIngestionSettings(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.PowerShell.cs similarity index 79% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.PowerShell.cs index 346d39bf4caa..c26d818550a4 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspaceMetrics 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 AzureMonitorWorkspaceMetrics(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("PrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("InternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId, 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 AzureMonitorWorkspaceMetrics(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("PrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("InternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId, 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspaceMetrics(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspaceMetrics(content); } @@ -145,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.TypeConverter.cs index f929875a7fe1..1716aea06fb1 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.cs similarity index 71% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.cs index a35231397de4..0d4502a4fbfe 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.cs @@ -3,35 +3,35 @@ // 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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Information about metrics for the Azure Monitor workspace public partial class AzureMonitorWorkspaceMetrics : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetricsInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetricsInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics __metrics = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics __metrics = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Metrics(); /// An internal identifier for the metrics container. Only to be used by the system [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string InternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)__metrics).InternalId; } + public string InternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)__metrics).InternalId; } /// Internal Acessors for InternalId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal.InternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)__metrics).InternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)__metrics).InternalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal.InternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)__metrics).InternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)__metrics).InternalId = value ?? null; } /// Internal Acessors for PrometheusQueryEndpoint - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal.PrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)__metrics).PrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)__metrics).PrometheusQueryEndpoint = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal.PrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)__metrics).PrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)__metrics).PrometheusQueryEndpoint = value ?? null; } /// The Prometheus query endpoint for the workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string PrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)__metrics).PrometheusQueryEndpoint; } + public string PrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)__metrics).PrometheusQueryEndpoint; } /// Creates an new instance. public AzureMonitorWorkspaceMetrics() @@ -54,13 +54,13 @@ public AzureMonitorWorkspaceMetrics() /// Information about metrics for the Azure Monitor workspace public partial interface IAzureMonitorWorkspaceMetrics : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics { } /// Information about metrics for the Azure Monitor workspace internal partial interface IAzureMonitorWorkspaceMetricsInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal { } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.json.cs index c7e5bfbd1abe..d1513e01876b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceMetrics.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceMetrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AzureMonitorWorkspaceMetrics(Microsoft.Azure.PowerShell.Cmdlets.Monitor { return; } - __metrics = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.Metrics(json); + __metrics = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Metrics(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceMetrics(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.PowerShell.cs new file mode 100644 index 000000000000..2fd12611b1a4 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.PowerShell.cs @@ -0,0 +1,350 @@ +// 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.Monitor.MonitorWorkspace.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + + /// An Azure Monitor Workspace definition + [System.ComponentModel.TypeConverter(typeof(AzureMonitorWorkspaceResourceTypeConverter))] + public partial class AzureMonitorWorkspaceResource + { + + /// + /// 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 AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MetricInternalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultIngestionSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).AccountId, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("MetricPrometheusQueryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); + } + if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); + } + if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, 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 AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("MetricInternalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricInternalId, global::System.Convert.ToString); + } + if (content.Contains("Metric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetricsTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultIngestionSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).AccountId, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).PublicNetworkAccess, global::System.Convert.ToString); + } + if (content.Contains("MetricPrometheusQueryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); + } + if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); + } + if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureMonitorWorkspaceResource(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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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(); + } + } + /// An Azure Monitor Workspace definition + [System.ComponentModel.TypeConverter(typeof(AzureMonitorWorkspaceResourceTypeConverter))] + public partial interface IAzureMonitorWorkspaceResource + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.TypeConverter.cs index 442e1f7f5526..09b60a20a54d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.cs similarity index 56% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.cs index 3132a16d1d95..3fda93265e07 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// An Azure Monitor Workspace definition public partial class AzureMonitorWorkspaceResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResource(); /// The immutable ID of the Azure Monitor workspace. This property is read-only. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).AccountId; } + public string AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).AccountId; } /// /// The Azure resource Id of the default data collection endpoint for this workspace. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionEndpointResourceId; } + public string DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionEndpointResourceId; } /// The Azure resource Id of the default data collection rule for this workspace. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionRuleResourceId; } + public string DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionRuleResourceId; } /// Backing field for property. private string _etag; @@ -49,100 +49,118 @@ public partial class AzureMonitorWorkspaceResource : /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Id; } /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.FormatTable(Index = 1)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)__trackedResource).Location = value ; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } /// An internal identifier for the metrics container. Only to be used by the system [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).MetricInternalId; } + public string MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).MetricInternalId; } /// The Prometheus query endpoint for the workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).MetricPrometheusQueryEndpoint; } + public string MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).MetricPrometheusQueryEndpoint; } /// Internal Acessors for AccountId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).AccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).AccountId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).AccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).AccountId = value ?? null; } /// Internal Acessors for DefaultIngestionSetting - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.DefaultIngestionSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSetting = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.DefaultIngestionSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSetting = value ?? null /* model class */; } /// Internal Acessors for DefaultIngestionSettingDataCollectionEndpointResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionEndpointResourceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionEndpointResourceId = value ?? null; } /// Internal Acessors for DefaultIngestionSettingDataCollectionRuleResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionRuleResourceId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).DefaultIngestionSettingDataCollectionRuleResourceId = value ?? null; } /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } /// Internal Acessors for Metric - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).Metric = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).Metric = value ?? null /* model class */; } /// Internal Acessors for MetricInternalId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).MetricInternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).MetricInternalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).MetricInternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).MetricInternalId = value ?? null; } /// Internal Acessors for MetricPrometheusQueryEndpoint - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).MetricPrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).MetricPrometheusQueryEndpoint = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).MetricPrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).MetricPrometheusQueryEndpoint = value ?? null; } /// Internal Acessors for PrivateEndpointConnection - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).PrivateEndpointConnection = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).PrivateEndpointConnection = value ?? null /* arrayOf */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for PublicNetworkAccess - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceInternal.PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).PublicNetworkAccess = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceInternal.PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).PublicNetworkAccess = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.FormatTable(Index = 0)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Name; } /// List of private endpoint connections [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).PrivateEndpointConnection; } + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).PrivateEndpointConnection; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties _property; /// Resource properties [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceProperties()); set => this._property = value; } /// /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).ProvisioningState; } /// Gets or sets allow or disallow public network access to workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.FormatTable(Index = 3)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)Property).PublicNetworkAccess; } + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)Property).PublicNetworkAccess; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] @@ -154,49 +172,49 @@ public partial class AzureMonitorWorkspaceResource : /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).SystemDataLastModifiedByType; } /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__trackedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__trackedResource).Type; } /// Creates an new instance. public AzureMonitorWorkspaceResource() @@ -219,12 +237,15 @@ public AzureMonitorWorkspaceResource() /// An Azure Monitor Workspace definition public partial interface IAzureMonitorWorkspaceResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource { /// The immutable ID of the Azure Monitor workspace. This property is read-only. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The immutable ID of the Azure Monitor workspace. This property is read-only.", SerializedName = @"accountId", PossibleTypes = new [] { typeof(string) })] @@ -235,6 +256,9 @@ public partial interface IAzureMonitorWorkspaceResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Azure resource Id of the default data collection endpoint for this workspace.", SerializedName = @"dataCollectionEndpointResourceId", PossibleTypes = new [] { typeof(string) })] @@ -243,6 +267,9 @@ public partial interface IAzureMonitorWorkspaceResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Azure resource Id of the default data collection rule for this workspace.", SerializedName = @"dataCollectionRuleResourceId", PossibleTypes = new [] { typeof(string) })] @@ -251,6 +278,9 @@ public partial interface IAzureMonitorWorkspaceResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource entity tag (ETag)", SerializedName = @"etag", PossibleTypes = new [] { typeof(string) })] @@ -259,6 +289,9 @@ public partial interface IAzureMonitorWorkspaceResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"An internal identifier for the metrics container. Only to be used by the system", SerializedName = @"internalId", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +300,9 @@ public partial interface IAzureMonitorWorkspaceResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Prometheus query endpoint for the workspace", SerializedName = @"prometheusQueryEndpoint", PossibleTypes = new [] { typeof(string) })] @@ -275,38 +311,49 @@ public partial interface IAzureMonitorWorkspaceResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of private endpoint connections", SerializedName = @"privateEndpointConnections", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection) })] + System.Collections.Generic.List PrivateEndpointConnection { get; } /// /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Creating", "Succeeded", "Deleting", "Failed", "Canceled")] + string ProvisioningState { get; } /// Gets or sets allow or disallow public network access to workspace [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Gets or sets allow or disallow public network access to workspace", SerializedName = @"publicNetworkAccess", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; } } /// An Azure Monitor Workspace definition internal partial interface IAzureMonitorWorkspaceResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal { /// The immutable ID of the Azure Monitor workspace. This property is read-only. string AccountId { get; set; } /// The Data Collection Rule and Endpoint used for ingestion by default. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings DefaultIngestionSetting { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings DefaultIngestionSetting { get; set; } /// /// The Azure resource Id of the default data collection endpoint for this workspace. /// @@ -316,21 +363,23 @@ internal partial interface IAzureMonitorWorkspaceResourceInternal : /// Resource entity tag (ETag) string Etag { get; set; } /// Information about metrics for the Azure Monitor workspace - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics Metric { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Metric { get; set; } /// An internal identifier for the metrics container. Only to be used by the system string MetricInternalId { get; set; } /// The Prometheus query endpoint for the workspace string MetricPrometheusQueryEndpoint { get; set; } /// List of private endpoint connections - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + System.Collections.Generic.List PrivateEndpointConnection { get; set; } /// Resource properties - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspace Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties Property { get; set; } /// /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Creating", "Succeeded", "Deleting", "Failed", "Canceled")] + string ProvisioningState { get; set; } /// Gets or sets allow or disallow public network access to workspace - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccess { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.json.cs similarity index 92% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.json.cs index fd6045299981..704537155991 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResource.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResource.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AzureMonitorWorkspaceResource(Microsoft.Azure.PowerShell.Cmdlets.Monito { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceResource(json) : null; } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. } __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.PowerShell.cs similarity index 78% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.PowerShell.cs index 765955fc8072..1856bed40cb5 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspaceResourceForUpdate 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,13 +78,13 @@ internal AzureMonitorWorkspaceResourceForUpdate(global::System.Collections.IDict // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTagsTypeConverter.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. @@ -99,35 +99,35 @@ internal AzureMonitorWorkspaceResourceForUpdate(global::System.Management.Automa // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTagsTypeConverter.ConvertFrom); } 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspaceResourceForUpdate(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspaceResourceForUpdate(content); } @@ -140,7 +140,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.TypeConverter.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.TypeConverter.cs index ebcb1bcfc162..3ea3d1c5bf0a 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.cs similarity index 74% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.cs index 436facc26b68..d999c50779f7 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Definition of ARM tracked top level resource properties for update operation public partial class AzureMonitorWorkspaceResourceForUpdate : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTags()); set => this._tag = value; } /// Creates an new instance. public AzureMonitorWorkspaceResourceForUpdate() @@ -34,10 +34,13 @@ public partial interface IAzureMonitorWorkspaceResourceForUpdate : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get; set; } } /// Definition of ARM tracked top level resource properties for update operation @@ -45,7 +48,7 @@ internal partial interface IAzureMonitorWorkspaceResourceForUpdateInternal { /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.json.cs similarity index 93% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.json.cs index 8e542dc5f748..e57debcdb9ea 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdate.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdate.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AzureMonitorWorkspaceResourceForUpdate(Microsoft.Azure.PowerShell.Cmdle { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceResourceForUpdate(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.PowerShell.cs similarity index 87% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.PowerShell.cs index ab4121a9e820..d0279d8de10f 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspaceResourceForUpdateTags 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 AzureMonitorWorkspaceResourceForUpdateTags(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 AzureMonitorWorkspaceResourceForUpdateTags(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspaceResourceForUpdateTags(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspaceResourceForUpdateTags(content); } @@ -136,7 +136,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.TypeConverter.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.TypeConverter.cs index 55a48e6f0844..51b931e4f8e6 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.cs similarity index 89% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.cs index 6174e93cb0a6..83c270da49ef 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Resource tags public partial class AzureMonitorWorkspaceResourceForUpdateTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTagsInternal { /// diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.dictionary.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.dictionary.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.dictionary.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.dictionary.cs index f721ceca39ad..2d80d977d1aa 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.dictionary.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdateTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdateTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.json.cs similarity index 95% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.json.cs index 2516f67f0903..eb988b1bb083 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceForUpdateTags.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceForUpdateTags.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AzureMonitorWorkspaceResourceForUpdateTags(Microsoft.Azure.PowerShell.C } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceResourceForUpdateTags(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.PowerShell.cs similarity index 72% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.PowerShell.cs index 3db373768126..e7bf0f356f1b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspaceResourceListResult 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 AzureMonitorWorkspaceResourceListResult(global::System.Collections.IDic // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)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 AzureMonitorWorkspaceResourceListResult(global::System.Management.Autom // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal)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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspaceResourceListResult(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspaceResourceListResult(content); } @@ -148,7 +148,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.TypeConverter.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.TypeConverter.cs index bf57ea795304..cdeb1e3573a8 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.cs similarity index 74% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.cs index 6f4195acd14d..1c8ea4217cc2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// A pageable list of resources public partial class AzureMonitorWorkspaceResourceListResult : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResultInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AzureMonitorWorkspaceResourceListResult : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource[] _value; + private System.Collections.Generic.List _value; /// A list of resources [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource[] 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 AzureMonitorWorkspaceResourceListResult() @@ -41,6 +41,9 @@ public partial interface IAzureMonitorWorkspaceResourceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL to use for getting the next set of results", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IAzureMonitorWorkspaceResourceListResult : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of resources", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource) })] + System.Collections.Generic.List Value { get; set; } } /// A pageable list of resources @@ -62,7 +68,7 @@ internal partial interface IAzureMonitorWorkspaceResourceListResultInternal /// The URL to use for getting the next set of results string NextLink { get; set; } /// A list of resources - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.json.cs similarity index 89% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.json.cs index 5488a7769724..1324c9289332 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceListResult.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceListResult.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AzureMonitorWorkspaceResourceListResult(Microsoft.Azure.PowerShell.Cmdl { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceResourceListResult(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.PowerShell.cs similarity index 53% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.PowerShell.cs index 4f9c7cc60fe7..009e120928e3 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AzureMonitorWorkspaceResourceProperties 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,49 +78,49 @@ internal AzureMonitorWorkspaceResourceProperties(global::System.Collections.IDic // actually deserialize if (content.Contains("MetricInternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); } if (content.Contains("MetricPrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, global::System.Convert.ToString); } if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.MetricsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetricsTypeConverter.ConvertFrom); } if (content.Contains("DefaultIngestionSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettingsTypeConverter.ConvertFrom); } if (content.Contains("AccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, 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. @@ -135,71 +135,71 @@ internal AzureMonitorWorkspaceResourceProperties(global::System.Management.Autom // actually deserialize if (content.Contains("MetricInternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId = (string) content.GetValueForProperty("MetricInternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricInternalId, global::System.Convert.ToString); } if (content.Contains("MetricPrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint = (string) content.GetValueForProperty("MetricPrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).MetricPrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DefaultIngestionSettingDataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId = (string) content.GetValueForProperty("DefaultIngestionSettingDataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSettingDataCollectionEndpointResourceId, global::System.Convert.ToString); } if (content.Contains("Metric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.MetricsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics) content.GetValueForProperty("Metric",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).Metric, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceMetricsTypeConverter.ConvertFrom); } if (content.Contains("DefaultIngestionSetting")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IngestionSettingsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings) content.GetValueForProperty("DefaultIngestionSetting",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).DefaultIngestionSetting, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceDefaultIngestionSettingsTypeConverter.ConvertFrom); } if (content.Contains("AccountId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId = (string) content.GetValueForProperty("AccountId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).AccountId, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointConnection")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection = (System.Collections.Generic.List) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionTypeConverter.ConvertFrom)); } if (content.Contains("PublicNetworkAccess")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess = (string) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)this).PublicNetworkAccess, 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AzureMonitorWorkspaceResourceProperties(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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AzureMonitorWorkspaceResourceProperties(content); } @@ -212,7 +212,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.TypeConverter.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.TypeConverter.cs index 66a3733484b1..e3547df8e4e2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.cs new file mode 100644 index 000000000000..7eee2aa014e1 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.cs @@ -0,0 +1,127 @@ +// 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.Monitor.MonitorWorkspace.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + + /// Resource properties + public partial class AzureMonitorWorkspaceResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourcePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace __azureMonitorWorkspace = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspace(); + + /// The immutable ID of the Azure Monitor workspace. This property is read-only. + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).AccountId; } + + /// The Data Collection Rule and Endpoint used for ingestion by default. + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings DefaultIngestionSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting = value ?? null /* model class */; } + + /// + /// The Azure resource Id of the default data collection endpoint for this workspace. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionEndpointResourceId; } + + /// The Azure resource Id of the default data collection rule for this workspace. + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionRuleResourceId; } + + /// Information about metrics for the Azure Monitor workspace + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric = value ?? null /* model class */; } + + /// An internal identifier for the metrics container. Only to be used by the system + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricInternalId; } + + /// The Prometheus query endpoint for the workspace + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricPrometheusQueryEndpoint; } + + /// Internal Acessors for AccountId + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.AccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).AccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).AccountId = value ?? null; } + + /// Internal Acessors for DefaultIngestionSetting + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceDefaultIngestionSettings Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.DefaultIngestionSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSetting = value ?? null /* model class */; } + + /// Internal Acessors for DefaultIngestionSettingDataCollectionEndpointResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionEndpointResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionEndpointResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionEndpointResourceId = value ?? null; } + + /// Internal Acessors for DefaultIngestionSettingDataCollectionRuleResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.DefaultIngestionSettingDataCollectionRuleResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionRuleResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).DefaultIngestionSettingDataCollectionRuleResourceId = value ?? null; } + + /// Internal Acessors for Metric + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceMetrics Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.Metric { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).Metric = value ?? null /* model class */; } + + /// Internal Acessors for MetricInternalId + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.MetricInternalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricInternalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricInternalId = value ?? null; } + + /// Internal Acessors for MetricPrometheusQueryEndpoint + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.MetricPrometheusQueryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricPrometheusQueryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).MetricPrometheusQueryEndpoint = value ?? null; } + + /// Internal Acessors for PrivateEndpointConnection + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PrivateEndpointConnection = value ?? null /* arrayOf */; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).ProvisioningState = value ?? null; } + + /// Internal Acessors for PublicNetworkAccess + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal.PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PublicNetworkAccess = value ?? null; } + + /// List of private endpoint connections + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public System.Collections.Generic.List PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PrivateEndpointConnection; } + + /// + /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).ProvisioningState; } + + /// Gets or sets allow or disallow public network access to workspace + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] + public string PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal)__azureMonitorWorkspace).PublicNetworkAccess; } + + /// Creates an new instance. + public AzureMonitorWorkspaceResourceProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureMonitorWorkspace), __azureMonitorWorkspace); + await eventListener.AssertObjectIsValid(nameof(__azureMonitorWorkspace), __azureMonitorWorkspace); + } + } + /// Resource properties + public partial interface IAzureMonitorWorkspaceResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspace + { + + } + /// Resource properties + internal partial interface IAzureMonitorWorkspaceResourcePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceInternal + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.json.cs index 655bcddf4b25..9b1f6429c8eb 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/AzureMonitorWorkspaceResourceProperties.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/AzureMonitorWorkspaceResourceProperties.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AzureMonitorWorkspaceResourceProperties(Microsoft.Azure.PowerShell.Cmdl { return; } - __azureMonitorWorkspace = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspace(json); + __azureMonitorWorkspace = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspace(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new AzureMonitorWorkspaceResourceProperties(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 78% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index bb476df2ba3d..5b81c771f445 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,35 +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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -106,17 +104,17 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -131,11 +129,11 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -145,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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index b2a938b12747..4740746f4988 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 87% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index 3ace0b1d954d..621b0631e87c 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index 1635e6b5d6a5..c863d4aeb294 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorAdditionalInfo.json.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorW { 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs similarity index 66% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs index 796659808881..83c98bf4df84 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs index 5efa70156136..d1151599a369 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.cs similarity index 67% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.cs index fe72c4d49c53..dea860a7e7d2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// The error detail. public partial class ErrorDetail : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[] _additionalInfo; + private System.Collections.Generic.List _additionalInfo; /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] _detail; + private System.Collections.Generic.List _detail; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.Api30.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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.json.cs similarity index 88% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorDetail.json.cs index d4f10889b372..715a87213121 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorDetail.json.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace { 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; } @@ -104,19 +104,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -128,7 +128,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 63% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index fcb126cf8f57..0d26d38326d2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetailTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetailTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 9837965a86b1..0f0e9bd5b527 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.cs similarity index 59% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.cs index 4b17db19fef5..fb01084a3c6d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -12,54 +12,54 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// the OData error response format.). /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal { /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).AdditionalInfo; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Code; } /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Detail; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Detail; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail _error; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail _error; /// The error object. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetail()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetail()); set => this._error = value; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).AdditionalInfo = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).AdditionalInfo = value ?? null /* arrayOf */; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Code = value ?? null; } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Detail = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Detail = value ?? null /* arrayOf */; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetail()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetail()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Message = value ?? null; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Target = value ?? null; } /// The error target. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetailInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetailInternal)Error).Target; } /// Creates an new instance. public ErrorResponse() @@ -76,14 +76,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorDetail Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorDetail Error { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ErrorResponse.json.cs index 2b4f284c29eb..08f3c87d8c90 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ErrorResponse.json.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspa { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorDetail.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorDetail.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.PowerShell.cs similarity index 77% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.PowerShell.cs index 72299836836b..3dbbaee1387a 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class IngestionSettings 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.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IngestionSettings(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.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IngestionSettings(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 IngestionSettings(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, 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 IngestionSettings(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("DataCollectionRuleResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId = (string) content.GetValueForProperty("DataCollectionRuleResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionRuleResourceId, global::System.Convert.ToString); } if (content.Contains("DataCollectionEndpointResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId = (string) content.GetValueForProperty("DataCollectionEndpointResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal)this).DataCollectionEndpointResourceId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.TypeConverter.cs index a6a4027044e7..fa5b03ec01f3 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.cs similarity index 87% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.cs index 4e06db6785ad..6ab5378a75be 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Settings for data ingestion public partial class IngestionSettings : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal { /// Backing field for property. @@ -30,10 +30,10 @@ public partial class IngestionSettings : public string DataCollectionRuleResourceId { get => this._dataCollectionRuleResourceId; } /// Internal Acessors for DataCollectionEndpointResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal.DataCollectionEndpointResourceId { get => this._dataCollectionEndpointResourceId; set { {_dataCollectionEndpointResourceId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal.DataCollectionEndpointResourceId { get => this._dataCollectionEndpointResourceId; set { {_dataCollectionEndpointResourceId = value;} } } /// Internal Acessors for DataCollectionRuleResourceId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettingsInternal.DataCollectionRuleResourceId { get => this._dataCollectionRuleResourceId; set { {_dataCollectionRuleResourceId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettingsInternal.DataCollectionRuleResourceId { get => this._dataCollectionRuleResourceId; set { {_dataCollectionRuleResourceId = value;} } } /// Creates an new instance. public IngestionSettings() @@ -51,6 +51,9 @@ public partial interface IIngestionSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Azure resource Id of the default data collection endpoint for this workspace.", SerializedName = @"dataCollectionEndpointResourceId", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IIngestionSettings : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Azure resource Id of the default data collection rule for this workspace.", SerializedName = @"dataCollectionRuleResourceId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.json.cs index 3412d9259b1c..ddc8e9b8db5d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/IngestionSettings.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/IngestionSettings.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IngestionSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IIngestionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IIngestionSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new IngestionSettings(json) : null; } @@ -77,8 +77,8 @@ internal IngestionSettings(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWor { return; } - {_dataCollectionRuleResourceId = If( json?.PropertyT("dataCollectionRuleResourceId"), out var __jsonDataCollectionRuleResourceId) ? (string)__jsonDataCollectionRuleResourceId : (string)DataCollectionRuleResourceId;} - {_dataCollectionEndpointResourceId = If( json?.PropertyT("dataCollectionEndpointResourceId"), out var __jsonDataCollectionEndpointResourceId) ? (string)__jsonDataCollectionEndpointResourceId : (string)DataCollectionEndpointResourceId;} + {_dataCollectionRuleResourceId = If( json?.PropertyT("dataCollectionRuleResourceId"), out var __jsonDataCollectionRuleResourceId) ? (string)__jsonDataCollectionRuleResourceId : (string)_dataCollectionRuleResourceId;} + {_dataCollectionEndpointResourceId = If( json?.PropertyT("dataCollectionEndpointResourceId"), out var __jsonDataCollectionEndpointResourceId) ? (string)__jsonDataCollectionEndpointResourceId : (string)_dataCollectionEndpointResourceId;} AfterFromJson(json); } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._dataCollectionRuleResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._dataCollectionRuleResourceId.ToString()) : null, "dataCollectionRuleResourceId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._dataCollectionEndpointResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._dataCollectionEndpointResourceId.ToString()) : null, "dataCollectionEndpointResourceId" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.PowerShell.cs similarity index 79% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.PowerShell.cs index 7165f8c028d6..f01c785e3e46 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Metrics 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.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Metrics(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.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Metrics(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 Metrics(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("InternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId, 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 Metrics(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("PrometheusQueryEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint = (string) content.GetValueForProperty("PrometheusQueryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).PrometheusQueryEndpoint, global::System.Convert.ToString); } if (content.Contains("InternalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal)this).InternalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId = (string) content.GetValueForProperty("InternalId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal)this).InternalId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.TypeConverter.cs index 94d4b69ae7d9..f80ae06a0b6b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.cs similarity index 88% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.cs index a7774b01859d..134b55e381be 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Information about metrics for the workspace public partial class Metrics : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class Metrics : public string InternalId { get => this._internalId; } /// Internal Acessors for InternalId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal.InternalId { get => this._internalId; set { {_internalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal.InternalId { get => this._internalId; set { {_internalId = value;} } } /// Internal Acessors for PrometheusQueryEndpoint - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetricsInternal.PrometheusQueryEndpoint { get => this._prometheusQueryEndpoint; set { {_prometheusQueryEndpoint = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetricsInternal.PrometheusQueryEndpoint { get => this._prometheusQueryEndpoint; set { {_prometheusQueryEndpoint = value;} } } /// Backing field for property. private string _prometheusQueryEndpoint; @@ -47,6 +47,9 @@ public partial interface IMetrics : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"An internal identifier for the metrics container. Only to be used by the system", SerializedName = @"internalId", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IMetrics : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The Prometheus query endpoint for the workspace", SerializedName = @"prometheusQueryEndpoint", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.json.cs similarity index 95% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.json.cs index 8a381efe5227..4f044351ec1f 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api20230403/Metrics.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Metrics.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.Monitor.MonitorWorkspace.Models.Api20230403 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Metrics partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IMetrics FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new Metrics(json) : null; } @@ -77,8 +77,8 @@ internal Metrics(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Run { return; } - {_prometheusQueryEndpoint = If( json?.PropertyT("prometheusQueryEndpoint"), out var __jsonPrometheusQueryEndpoint) ? (string)__jsonPrometheusQueryEndpoint : (string)PrometheusQueryEndpoint;} - {_internalId = If( json?.PropertyT("internalId"), out var __jsonInternalId) ? (string)__jsonInternalId : (string)InternalId;} + {_prometheusQueryEndpoint = If( json?.PropertyT("prometheusQueryEndpoint"), out var __jsonPrometheusQueryEndpoint) ? (string)__jsonPrometheusQueryEndpoint : (string)_prometheusQueryEndpoint;} + {_internalId = If( json?.PropertyT("internalId"), out var __jsonInternalId) ? (string)__jsonInternalId : (string)_internalId;} AfterFromJson(json); } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._prometheusQueryEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._prometheusQueryEndpoint.ToString()) : null, "prometheusQueryEndpoint" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._internalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._internalId.ToString()) : null, "internalId" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.cs index 885e0fc87b1c..05d66d3eac5f 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.cs @@ -53,6 +53,9 @@ public partial interface IMonitorWorkspaceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Azure Monitor workspace. The name is case insensitive", SerializedName = @"azureMonitorWorkspaceName", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IMonitorWorkspaceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +75,9 @@ public partial interface IMonitorWorkspaceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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) })] @@ -77,6 +86,9 @@ public partial interface IMonitorWorkspaceIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.json.cs index 2e01d8d53e11..682d2fe19c4e 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/MonitorWorkspaceIdentity.json.cs @@ -76,10 +76,10 @@ internal MonitorWorkspaceIdentity(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Mon { 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;} - {_azureMonitorWorkspaceName = If( json?.PropertyT("azureMonitorWorkspaceName"), out var __jsonAzureMonitorWorkspaceName) ? (string)__jsonAzureMonitorWorkspaceName : (string)AzureMonitorWorkspaceName;} - {_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;} + {_azureMonitorWorkspaceName = If( json?.PropertyT("azureMonitorWorkspaceName"), out var __jsonAzureMonitorWorkspaceName) ? (string)__jsonAzureMonitorWorkspaceName : (string)_azureMonitorWorkspaceName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 61% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.PowerShell.cs index c2de96e6967b..cb4dcdc9ea8b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class Operation 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.Monitor.MonitorWorkspace.Models.Api30.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(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.Monitor.MonitorWorkspace.Models.Api30.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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,45 +113,45 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ActionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).ActionType, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)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. @@ -166,39 +166,39 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ActionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).ActionType, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.TypeConverter.cs index 9cf89acd27a1..700a2d7277c2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.cs similarity index 74% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.cs index 2b9035e515e3..f9ac54ce31ab 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -11,50 +11,50 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// Details of a REST API operation, returned from the Resource Provider Operations API /// public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType? _actionType; + private string _actionType; /// /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType? ActionType { get => this._actionType; } + public string ActionType { get => this._actionType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay _display; /// Localized display information for this particular operation. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationDisplay()); set => this._display = value; } /// /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Description; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Description; } /// /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", /// "Restart Virtual Machine". /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Operation; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Operation; } /// /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Provider; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Provider; } /// /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Resource; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Resource; } /// Backing field for property. private bool? _isDataAction; @@ -67,31 +67,31 @@ public partial class Operation : public bool? IsDataAction { get => this._isDataAction; } /// Internal Acessors for ActionType - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationDisplay()); set { {_display = value;} } } /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Operation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Provider = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)Display).Resource = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for IsDataAction - bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } + bool? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Origin - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationInternal.Origin { get => this._origin; set { {_origin = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationInternal.Origin { get => this._origin; set { {_origin = value;} } } /// Backing field for property. private string _name; @@ -104,14 +104,14 @@ public partial class Operation : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin? _origin; + private string _origin; /// /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is /// "user,system" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin? Origin { get => this._origin; } + public string Origin { get => this._origin; } /// Creates an new instance. public Operation() @@ -129,16 +129,23 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Enum. Indicates the action type. ""Internal"" refers to actions that are for internal only APIs.", SerializedName = @"actionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType? ActionType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Internal")] + string ActionType { get; } /// /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +157,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -160,6 +170,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -170,6 +183,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -181,6 +197,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether the operation applies to data-plane. This is ""true"" for data-plane operations and ""false"" for ARM/control-plane operations.", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -192,6 +211,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the operation, as per Resource-Based Access Control (RBAC). Examples: ""Microsoft.Compute/virtualMachines/write"", ""Microsoft.Compute/virtualMachines/capture/action""", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -203,10 +225,14 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is ""user,system""", SerializedName = @"origin", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin? Origin { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("user", "system", "user,system")] + string Origin { get; } } /// Details of a REST API operation, returned from the Resource Provider Operations API @@ -216,9 +242,10 @@ internal partial interface IOperationInternal /// /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType? ActionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Internal")] + string ActionType { get; set; } /// Localized display information for this particular operation. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay Display { get; set; } /// /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. /// @@ -250,7 +277,8 @@ internal partial interface IOperationInternal /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is /// "user,system" /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin? Origin { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("user", "system", "user,system")] + string Origin { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.json.cs index f9a8bca95c76..fdf5649079a0 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/Operation.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Operation.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -79,11 +79,11 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.R { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)ActionType;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)_actionType;} AfterFromJson(json); } @@ -107,19 +107,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. return container; } AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._actionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._actionType.ToString()) : null, "actionType" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 73% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 2b1b2a93dce7..2f41154ef521 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,29 +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.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -146,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 15ee1f98eca5..1e774ad93041 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.cs similarity index 89% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.cs index bad0c984361b..e208a861d07b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Localized display information for this particular operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal { /// Backing field for property. @@ -23,16 +23,16 @@ public partial class OperationDisplay : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } /// Backing field for property. private string _operation; @@ -78,6 +78,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +92,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +105,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 95% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationDisplay.json.cs index c8fd81c1904c..6853b9d3ba99 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationDisplay.json.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWork { 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); } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 76% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index 85dd86bdc459..8b0210867717 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -66,29 +66,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.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -98,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -116,17 +114,17 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -141,11 +139,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index 91d1b7e1b623..e05fe976a0e5 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.cs similarity index 74% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.cs index 26ad0c5219e9..c15e925addf1 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -12,15 +12,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// results. /// public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -30,11 +30,11 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[] _value; + private System.Collections.Generic.List _value; /// List of operations supported by the resource provider [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public OperationListResult() @@ -51,6 +51,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next set of operation list results (if there are any).", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -59,10 +62,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of operations supported by the resource provider", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperation) })] + System.Collections.Generic.List Value { get; } } /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of @@ -73,7 +79,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 resource provider - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 91% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/OperationListResult.json.cs index bd4a04e54d07..3d7a64f2e050 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/OperationListResult.json.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -80,8 +80,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorW { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.Operation.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -116,7 +116,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs similarity index 84% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.PowerShell.cs index cdc0625d81dd..212ea164cac7 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PrivateEndpoint 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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpoint(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpoint(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 PrivateEndpoint(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)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 PrivateEndpoint(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.TypeConverter.cs index f409700823ec..5af0c1ebb5ef 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.cs similarity index 90% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.cs index 8aceaf43bceb..fc44077074b6 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// The private endpoint resource. public partial class PrivateEndpoint : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class PrivateEndpoint : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } /// Creates an new instance. public PrivateEndpoint() @@ -37,6 +37,9 @@ public partial interface IPrivateEndpoint : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for private endpoint.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.json.cs similarity index 95% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.json.cs index 623aec6880fc..e89a1182e229 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpoint.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpoint.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpoint partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; } @@ -77,7 +77,7 @@ internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorks { 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); } @@ -100,7 +100,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs new file mode 100644 index 000000000000..768cc7138233 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.PowerShell.cs @@ -0,0 +1,310 @@ +// 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.Monitor.MonitorWorkspace.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + + /// The private endpoint connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial class PrivateEndpointConnection + { + + /// + /// 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.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, 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 PrivateEndpointConnection(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.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, 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.Monitor.MonitorWorkspace.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(); + } + } + /// The private endpoint connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial interface IPrivateEndpointConnection + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.TypeConverter.cs index 88be939ed65e..f141555f1b66 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.cs similarity index 52% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.cs index 5ad022f02dde..d9d98e82afe6 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.cs @@ -3,132 +3,150 @@ // 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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// The private endpoint connection resource. public partial class PrivateEndpointConnection : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Resource(); /// The group ids for the private endpoint resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string[] GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId; } + public System.Collections.Generic.List GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId; } /// /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for GroupId - string[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).GroupId = value ?? null /* arrayOf */; } /// Internal Acessors for PrivateEndpoint - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value ?? null /* model class */; } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value ?? null; } /// Internal Acessors for PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Name; } /// The ARM identifier for private endpoint. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties _property; /// Resource properties. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionProperties()); set => this._property = value; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public PrivateEndpointConnection() @@ -151,20 +169,26 @@ public PrivateEndpointConnection() /// The private endpoint connection resource. public partial interface IPrivateEndpointConnection : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource { /// The group ids for the private endpoint resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The group ids for the private endpoint resource.", SerializedName = @"groupIds", PossibleTypes = new [] { typeof(string) })] - string[] GroupId { get; } + System.Collections.Generic.List GroupId { get; } /// The ARM identifier for private endpoint. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for private endpoint.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -175,6 +199,9 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -183,6 +210,9 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -193,34 +223,42 @@ public partial interface IPrivateEndpointConnection : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the private endpoint connection resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; } } /// The private endpoint connection resource. internal partial interface IPrivateEndpointConnectionInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal { /// The group ids for the private endpoint resource. - string[] GroupId { get; set; } + System.Collections.Generic.List GroupId { get; set; } /// The private endpoint resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint PrivateEndpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint PrivateEndpoint { get; set; } /// The ARM identifier for private endpoint. string PrivateEndpointId { get; set; } /// /// A collection of information about the state of the connection between service consumer and provider. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// @@ -230,11 +268,13 @@ internal partial interface IPrivateEndpointConnectionInternal : /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// Resource properties. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties Property { get; set; } /// The provisioning state of the private endpoint connection resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs similarity index 93% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.json.cs index 20124e558211..f4d960ab0e0d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnection.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnection.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; } @@ -77,8 +77,8 @@ internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Mo { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs similarity index 55% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.PowerShell.cs index e3f16afa85bc..9bd8af26d41e 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class PrivateEndpointConnectionProperties 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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateEndpointConnectionProperties(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateEndpointConnectionProperties(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -115,41 +115,41 @@ internal PrivateEndpointConnectionProperties(global::System.Collections.IDiction // actually deserialize if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, 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. @@ -164,35 +164,35 @@ internal PrivateEndpointConnectionProperties(global::System.Management.Automatio // actually deserialize if (content.Contains("PrivateEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpointTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpointTypeConverter.ConvertFrom); } if (content.Contains("PrivateLinkServiceConnectionState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); } if (content.Contains("GroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).GroupId = (string[]) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).GroupId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).GroupId = (System.Collections.Generic.List) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).GroupId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("PrivateEndpointId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionsRequired, global::System.Convert.ToString); } if (content.Contains("PrivateLinkServiceConnectionStateStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.TypeConverter.cs index 15a627daf147..4ac2f5c52df7 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs similarity index 61% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs index 6b2293d53423..47c326751b55 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.cs @@ -3,80 +3,80 @@ // 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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Properties of the private endpoint connection. public partial class PrivateEndpointConnectionProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal { /// Backing field for property. - private string[] _groupId; + private System.Collections.Generic.List _groupId; /// The group ids for the private endpoint resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public string[] GroupId { get => this._groupId; } + public System.Collections.Generic.List GroupId { get => this._groupId; } /// Internal Acessors for GroupId - string[] Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } /// Internal Acessors for PrivateEndpoint - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpoint()); set { {_privateEndpoint = value;} } } /// Internal Acessors for PrivateEndpointId - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)PrivateEndpoint).Id = value ?? null; } /// Internal Acessors for PrivateLinkServiceConnectionState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint _privateEndpoint; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint _privateEndpoint; /// The private endpoint resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpoint()); set => this._privateEndpoint = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpoint()); set => this._privateEndpoint = value; } /// The ARM identifier for private endpoint. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointInternal)PrivateEndpoint).Id; } + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointInternal)PrivateEndpoint).Id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; /// /// A collection of information about the state of the connection between service consumer and provider. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } + public string PrivateLinkServiceConnectionStateActionsRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionsRequired = value ?? null; } /// The reason for approval/rejection of the connection. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus)""); } + public string PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public PrivateEndpointConnectionProperties() @@ -92,14 +92,20 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The group ids for the private endpoint resource.", SerializedName = @"groupIds", PossibleTypes = new [] { typeof(string) })] - string[] GroupId { get; } + System.Collections.Generic.List GroupId { get; } /// The ARM identifier for private endpoint. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ARM identifier for private endpoint.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -110,6 +116,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +127,9 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -128,18 +140,26 @@ public partial interface IPrivateEndpointConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the private endpoint connection resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; } } /// Properties of the private endpoint connection. @@ -147,15 +167,15 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal { /// The group ids for the private endpoint resource. - string[] GroupId { get; set; } + System.Collections.Generic.List GroupId { get; set; } /// The private endpoint resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpoint PrivateEndpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpoint PrivateEndpoint { get; set; } /// The ARM identifier for private endpoint. string PrivateEndpointId { get; set; } /// /// A collection of information about the state of the connection between service consumer and provider. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// /// A message indicating if changes on the service provider require any updates on the consumer. /// @@ -165,9 +185,11 @@ internal partial interface IPrivateEndpointConnectionPropertiesInternal /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string PrivateLinkServiceConnectionStateStatus { get; set; } /// The provisioning state of the private endpoint connection resource. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Succeeded", "Creating", "Deleting", "Failed")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs similarity index 90% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.json.cs index b615f3c605fa..672365ce4f84 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateEndpointConnectionProperties.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateEndpointConnectionProperties.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateEndpointConnectionProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; } @@ -77,10 +77,10 @@ internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} - {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} - {_groupId = If( json?.PropertyT("groupIds"), out var __jsonGroupIds) ? If( __jsonGroupIds as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : GroupId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : _privateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : _privateLinkServiceConnectionState;} + {_groupId = If( json?.PropertyT("groupIds"), out var __jsonGroupIds) ? If( __jsonGroupIds as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _groupId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. } AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { if (null != this._groupId) { @@ -118,7 +118,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. container.Add("groupIds",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs similarity index 72% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.PowerShell.cs index 7297001db6a5..2aa96965e800 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class PrivateLinkServiceConnectionState 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 . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateLinkServiceConnectionState(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.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateLinkServiceConnectionState(content); } @@ -99,10 +99,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -117,21 +117,21 @@ internal PrivateLinkServiceConnectionState(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, 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. @@ -146,15 +146,15 @@ internal PrivateLinkServiceConnectionState(global::System.Management.Automation. // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("ActionsRequired")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired = (string) content.GetValueForProperty("ActionsRequired",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal)this).ActionsRequired, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.TypeConverter.cs index 1562369ce53b..5823bd5f6165 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs similarity index 84% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.cs index d2c55ff521be..2370c66981cd 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// A collection of information about the state of the connection between service consumer and provider. /// public partial class PrivateLinkServiceConnectionState : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionStateInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionStateInternal { /// Backing field for property. @@ -32,13 +32,13 @@ public partial class PrivateLinkServiceConnectionState : public string Description { get => this._description; set => this._description = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? _status; + private string _status; /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public PrivateLinkServiceConnectionState() @@ -56,6 +56,9 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A message indicating if changes on the service provider require any updates on the consumer.", SerializedName = @"actionsRequired", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +67,9 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for approval/rejection of the connection.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -74,10 +80,14 @@ public partial interface IPrivateLinkServiceConnectionState : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string Status { get; set; } } /// A collection of information about the state of the connection between service consumer and provider. @@ -93,7 +103,8 @@ internal partial interface IPrivateLinkServiceConnectionStateInternal /// /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("Pending", "Approved", "Rejected")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs similarity index 95% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.json.cs index 17148acd6066..532236de7532 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/PrivateLinkServiceConnectionState.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/PrivateLinkServiceConnectionState.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PrivateLinkServiceConnectionState partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; } @@ -79,9 +79,9 @@ internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.Mo { return; } - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)ActionsRequired;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_actionsRequired = If( json?.PropertyT("actionsRequired"), out var __jsonActionsRequired) ? (string)__jsonActionsRequired : (string)_actionsRequired;} AfterFromJson(json); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 57% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.PowerShell.cs index 3b1644826468..f425a12970bf 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class Resource 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.Monitor.MonitorWorkspace.Models.Api40.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Resource(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.Monitor.MonitorWorkspace.Models.Api40.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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,49 +113,49 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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,43 +170,43 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)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("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal)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.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal)this).SystemDataLastModifiedAt, (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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.TypeConverter.cs index e7c4b53fbe64..2dc68082c7f0 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api40.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.cs similarity index 63% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.cs index 1136c393e2c1..0c5020666241 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal { /// Backing field for property. @@ -25,16 +25,34 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,37 +62,37 @@ public partial class Resource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData _systemData; /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -101,6 +119,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fully qualified resource ID for the resource. E.g. ""/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}""", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +130,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -116,57 +140,80 @@ public partial interface IResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -186,19 +233,21 @@ internal partial interface IResourceInternal /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.json.cs similarity index 93% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.json.cs index 79b87f0a9fdd..79a89fcb06d4 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api40/Resource.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Resource.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.Monitor.MonitorWorkspace.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api40.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,10 +79,10 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Ru { return; } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.PowerShell.cs similarity index 55% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.PowerShell.cs index ff05a9d829dc..b758a3cb908d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class ResourceAutoGenerated 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.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceAutoGenerated(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.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceAutoGenerated(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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. @@ -115,49 +113,49 @@ internal ResourceAutoGenerated(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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. @@ -172,43 +170,43 @@ internal ResourceAutoGenerated(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt, (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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.TypeConverter.cs index a546b7d1ff15..20060067a0db 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.cs similarity index 62% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.cs index 8f8d90bdfc02..5afc0cdedd6b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class ResourceAutoGenerated : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal { /// Backing field for property. @@ -25,16 +25,34 @@ public partial class ResourceAutoGenerated : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,37 +62,37 @@ public partial class ResourceAutoGenerated : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData _systemData; /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -101,6 +119,9 @@ public partial interface IResourceAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +130,9 @@ public partial interface IResourceAutoGenerated : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -116,57 +140,80 @@ public partial interface IResourceAutoGenerated : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -186,19 +233,21 @@ internal partial interface IResourceAutoGeneratedInternal /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.json.cs similarity index 93% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.json.cs index 20b76a014b10..217f7b09d3b7 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/ResourceAutoGenerated.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/ResourceAutoGenerated.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ResourceAutoGenerated partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new ResourceAutoGenerated(json) : null; } @@ -79,10 +79,10 @@ internal ResourceAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Monitor.Monito { return; } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 64% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.PowerShell.cs index a9f86c5f7b50..d9a1cac49da2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.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.Monitor.MonitorWorkspace.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.TypeConverter.cs index a13145dcd5d7..451751294b25 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.cs index 6ca642a8b3f1..4b2f84756638 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.json.cs similarity index 94% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/SystemData.json.cs index 3c3e2d5cf737..ddfada3425b2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/SystemData.json.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace. { 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/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.PowerShell.cs similarity index 53% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.PowerShell.cs index 833b102c4f18..aba3088f7253 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class TrackedResource 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.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrackedResource(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.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResource(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,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. @@ -130,57 +130,57 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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. @@ -195,51 +195,51 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)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.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)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("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs index fbc11f2d3482..f603a4a389f9 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.cs similarity index 53% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.cs index e203527e10e7..fbed89f535c1 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -11,21 +11,21 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' /// public partial class TrackedResource : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ResourceAutoGenerated(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ResourceAutoGenerated(); /// /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; } /// Backing field for property. private string _location; @@ -35,63 +35,81 @@ public partial class TrackedResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Id = value ?? null; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name = value ?? null; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = value ?? null; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type = value ?? null; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Name; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).SystemDataLastModifiedByType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags _tag; /// Resource tags. [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTags()); set => this._tag = value; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal)__resourceAutoGenerated).Type; } /// Creates an new instance. public TrackedResource() @@ -114,12 +132,15 @@ public TrackedResource() /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' public partial interface ITrackedResource : Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGenerated { /// The geo-location where the resource lives [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The geo-location where the resource lives", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -128,20 +149,23 @@ public partial interface ITrackedResource : [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags Tag { get; set; } } /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' internal partial interface ITrackedResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.IResourceAutoGeneratedInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IResourceAutoGeneratedInternal { /// The geo-location where the resource lives string Location { get; set; } /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.json.cs similarity index 87% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.json.cs index 9448cf855223..b69484d67dfa 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResource.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResource.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrackedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; } @@ -88,7 +88,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json. } __resourceAutoGenerated?.ToJson(container, serializationMode); AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AfterToJson(ref container); return container; } @@ -105,9 +108,9 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorks { return; } - __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ResourceAutoGenerated(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + __resourceAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ResourceAutoGenerated(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.PowerShell.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs similarity index 88% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.PowerShell.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs index 509cf3fa7e8d..1fc05e27271f 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.PowerShell.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class TrackedResourceTags 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.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrackedResourceTags(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.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResourceTags(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,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. @@ -134,7 +132,7 @@ internal TrackedResourceTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs similarity index 97% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.TypeConverter.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs index 6941fc8335e0..900d3567dbc2 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.TypeConverter.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.cs similarity index 92% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.cs index b36ddf3d309b..f77867868e19 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; /// Resource tags. public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTagsInternal { /// Creates an new instance. diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.dictionary.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.dictionary.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs index 3975c10ded70..4f97beaee7a6 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.dictionary.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api30.TrackedResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.TrackedResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.json.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.json.cs similarity index 96% rename from generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.json.cs rename to generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.json.cs index 0310099b54d0..fb53463bafcf 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/Api30/TrackedResourceTags.json.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Models/TrackedResourceTags.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.Monitor.MonitorWorkspace.Models.Api30 +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrackedResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/MonitorWorkspace.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/MonitorWorkspace.cs index ea59d5afd667..2809841a0e5b 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/MonitorWorkspace.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/MonitorWorkspace.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace public partial class MonitorWorkspace { - /// Create or update a workspace + /// create a workspace /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Monitor workspace. The name is case insensitive @@ -25,10 +25,11 @@ public partial class MonitorWorkspace /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesCreate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -55,15 +56,15 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Create or update a workspace + /// create a workspace /// /// Properties that need to be specified to create a new workspace /// a delegate that is called when the remote service returns 200 (OK). @@ -72,10 +73,11 @@ public partial class MonitorWorkspace /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -114,15 +116,282 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// create a workspace + /// + /// Properties that need to be specified to create a new workspace + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/(?[^/]+)$", 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.Monitor/accounts/{azureMonitorWorkspaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var azureMonitorWorkspaceName = _match.Groups["azureMonitorWorkspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Monitor/accounts/" + + azureMonitorWorkspaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// Json string supplied to the AzureMonitorWorkspacesCreate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// 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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreateViaJsonString(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AzureMonitorWorkspacesCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// create a workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// Json string supplied to the AzureMonitorWorkspacesCreate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// Properties that need to be specified to create a new workspace + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreateWithResult(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesCreateWithResult_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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 201 (Created). @@ -133,7 +402,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -144,6 +413,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -151,19 +421,19 @@ public partial class MonitorWorkspace case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -190,7 +460,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesCreate_Validate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesCreate_Validate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -200,7 +470,7 @@ public partial class MonitorWorkspace await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName); - await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName,@"^(?!-)[a-zA-Z0-9-]+[^-]$"); + await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName), azureMonitorWorkspaceName, @"^(?!-)[a-zA-Z0-9-]+[^-]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -211,6 +481,7 @@ public partial class MonitorWorkspace /// The name of the resource group. The name is case insensitive. /// The name of the Azure Monitor workspace. The name is case insensitive /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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. @@ -218,7 +489,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesDelete(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesDelete(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -245,13 +516,14 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesDelete_Call(request,onNoContent,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } /// Delete a workspace /// /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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. @@ -259,7 +531,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -298,13 +570,14 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesDelete_Call(request,onNoContent,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesDelete_Call (request, onNoContent,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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. @@ -312,32 +585,29 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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: location 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 ) { - - // 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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"))) { @@ -346,15 +616,14 @@ public partial class MonitorWorkspace 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.Monitor.MonitorWorkspace.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(); @@ -363,45 +632,45 @@ public partial class MonitorWorkspace _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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; - 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.Monitor.MonitorWorkspace.Runtime.UndeclaredResponseException(_response); - } - } + } + + 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.Monitor.MonitorWorkspace.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -420,10 +689,17 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -433,7 +709,7 @@ public partial class MonitorWorkspace default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -469,7 +745,7 @@ public partial class MonitorWorkspace await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName); - await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName,@"^(?!-)[a-zA-Z0-9-]+[^-]$"); + await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName), azureMonitorWorkspaceName, @"^(?!-)[a-zA-Z0-9-]+[^-]$"); } } @@ -485,7 +761,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesGet(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesGet(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -512,7 +788,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -526,7 +802,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesGetViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesGetViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -565,45 +841,200 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesGet_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). + /// Returns the specific Azure Monitor workspace + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesGet_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var azureMonitorWorkspaceName = _match.Groups["azureMonitorWorkspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Monitor/accounts/" + + azureMonitorWorkspaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Returns the specific Azure Monitor workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesGetWithResult(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesGetWithResult_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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesGet_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -639,7 +1070,7 @@ public partial class MonitorWorkspace await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName); - await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName,@"^(?!-)[a-zA-Z0-9-]+[^-]$"); + await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName), azureMonitorWorkspaceName, @"^(?!-)[a-zA-Z0-9-]+[^-]$"); } } @@ -654,7 +1085,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListByResourceGroup(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListByResourceGroup(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -680,7 +1111,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } @@ -694,7 +1125,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListByResourceGroupViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListByResourceGroupViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -731,12 +1162,162 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all workspaces in the specified resource group + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts$", 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.Monitor/accounts'"); + } + + // 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.Monitor/accounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all workspaces in 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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesListByResourceGroupWithResult_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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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). @@ -747,7 +1328,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListByResourceGroup_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListByResourceGroup_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -758,6 +1339,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -765,13 +1347,13 @@ public partial class MonitorWorkspace case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -818,7 +1400,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -842,7 +1424,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -856,7 +1438,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListBySubscriptionViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListBySubscriptionViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -890,33 +1472,178 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesListBySubscription_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). + /// Lists all workspaces in the specified subscription + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListBySubscription_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { + var apiVersion = @"2023-04-03"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Monitor/accounts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Monitor/accounts'"); + } + + // 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.Monitor/accounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all workspaces in the specified subscription + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Monitor/accounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesListBySubscriptionWithResult_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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesListBySubscription_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -924,13 +1651,13 @@ public partial class MonitorWorkspace case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -963,7 +1690,7 @@ public partial class MonitorWorkspace } } - /// Updates part of a workspace + /// update part of a workspace /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the Azure Monitor workspace. The name is case insensitive @@ -973,10 +1700,11 @@ public partial class MonitorWorkspace /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesUpdate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -1003,15 +1731,15 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Updates part of a workspace + /// update part of a workspace /// /// The payload /// a delegate that is called when the remote service returns 200 (OK). @@ -1019,10 +1747,11 @@ public partial class MonitorWorkspace /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AzureMonitorWorkspacesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -1061,15 +1790,275 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AzureMonitorWorkspacesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AzureMonitorWorkspacesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update part of a workspace + /// + /// The payload + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/(?[^/]+)$", 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.Monitor/accounts/{azureMonitorWorkspaceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var azureMonitorWorkspaceName = _match.Groups["azureMonitorWorkspaceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Monitor/accounts/" + + azureMonitorWorkspaceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update part of a workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// Json string supplied to the AzureMonitorWorkspacesUpdate 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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, 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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AzureMonitorWorkspacesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update part of a workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// Json string supplied to the AzureMonitorWorkspacesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update part of a workspace + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive + /// The payload + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdateWithResult(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-04-03"; + // 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.Monitor/accounts/" + + global::System.Uri.EscapeDataString(azureMonitorWorkspaceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AzureMonitorWorkspacesUpdateWithResult_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.Monitor.MonitorWorkspace.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 AzureMonitorWorkspacesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 @@ -1079,7 +2068,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesUpdate_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesUpdate_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1090,6 +2079,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1097,13 +2087,13 @@ public partial class MonitorWorkspace case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1130,7 +2120,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesUpdate_Validate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AzureMonitorWorkspacesUpdate_Validate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate body, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1140,7 +2130,7 @@ public partial class MonitorWorkspace await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName); - await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName),azureMonitorWorkspaceName,@"^(?!-)[a-zA-Z0-9-]+[^-]$"); + await eventListener.AssertRegEx(nameof(azureMonitorWorkspaceName), azureMonitorWorkspaceName, @"^(?!-)[a-zA-Z0-9-]+[^-]$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -1155,7 +2145,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorOperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorOperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -1177,7 +2167,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorOperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorOperationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1191,7 +2181,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MonitorOperationsListViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MonitorOperationsListViaIdentity(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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { var apiVersion = @"2023-04-03"; // Constant Parameters @@ -1222,11 +2212,147 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MonitorOperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.MonitorOperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists available Operations for this Resource Provider + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 MonitorOperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Monitor/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Monitor/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Monitor/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorOperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists available Operations for this Resource Provider + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 MonitorOperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-04-03"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Monitor/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MonitorOperationsListWithResult_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.Monitor.MonitorWorkspace.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 MonitorOperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 @@ -1236,7 +2362,7 @@ public partial class MonitorWorkspace /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MonitorOperationsList_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MonitorOperationsList_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.Monitor.MonitorWorkspace.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1247,6 +2373,7 @@ public partial class MonitorWorkspace await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1254,13 +2381,13 @@ public partial class MonitorWorkspace case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.Completer.cs deleted file mode 100644 index cbcfb7be8c4d..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.Completer.cs +++ /dev/null @@ -1,37 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionTypeTypeConverter))] - public partial struct ActionType : - 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) || "Internal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Internal'", "Internal", global::System.Management.Automation.CompletionResultType.ParameterValue, "Internal"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.TypeConverter.cs deleted file mode 100644 index 76771c344285..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.TypeConverter.cs +++ /dev/null @@ -1,61 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial class ActionTypeTypeConverter : - 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) => ActionType.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.cs deleted file mode 100644 index 7a9b4b18dd63..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ActionType.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.Monitor.MonitorWorkspace.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial struct ActionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType Internal = @"Internal"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ActionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ActionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ActionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ActionType - /// 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.Monitor.MonitorWorkspace.Support.ActionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ActionType (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 ActionType && Equals((ActionType)obj); - } - - /// Returns hashCode for enum ActionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ActionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ActionType - /// the value to convert to an instance of . - - public static implicit operator ActionType(string value) - { - return new ActionType(value); - } - - /// Implicit operator to convert ActionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType e) - { - return e._value; - } - - /// Overriding != operator for enum ActionType - /// 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.Monitor.MonitorWorkspace.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ActionType - /// 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.Monitor.MonitorWorkspace.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ActionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index f47e31a4a0e2..000000000000 --- a/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 5c929a544362..000000000000 --- a/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/CreatedByType.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 0cdd0d65118a..000000000000 --- a/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.Completer.cs deleted file mode 100644 index b0f523d926e6..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.Completer.cs +++ /dev/null @@ -1,46 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.OriginTypeConverter))] - public partial struct Origin : - 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) || "system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'system'", "system", global::System.Management.Automation.CompletionResultType.ParameterValue, "system"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "user,system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'user,system'", "user,system", global::System.Management.Automation.CompletionResultType.ParameterValue, "user,system"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.TypeConverter.cs deleted file mode 100644 index 27a212cbb2d3..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.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.Monitor.MonitorWorkspace.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - public partial class OriginTypeConverter : - 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) => Origin.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.cs deleted file mode 100644 index e4fff242ddda..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/Origin.cs +++ /dev/null @@ -1,103 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - public partial struct Origin : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin System = @"system"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin User = @"user"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin UserSystem = @"user,system"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Origin - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Origin(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Origin - /// 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.Monitor.MonitorWorkspace.Support.Origin e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Origin (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 Origin && Equals((Origin)obj); - } - - /// Returns hashCode for enum Origin - /// 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 Origin(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Origin - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Origin - /// the value to convert to an instance of . - - public static implicit operator Origin(string value) - { - return new Origin(value); - } - - /// Implicit operator to convert Origin to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin e) - { - return e._value; - } - - /// Overriding != operator for enum Origin - /// 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.Monitor.MonitorWorkspace.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Origin - /// 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.Monitor.MonitorWorkspace.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.Origin e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs deleted file mode 100644 index c4920806b3c8..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.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.Monitor.MonitorWorkspace.Support -{ - - /// The current provisioning state. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningStateTypeConverter))] - public partial struct PrivateEndpointConnectionProvisioningState : - 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) || "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) || "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) || "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) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs deleted file mode 100644 index 34ff38fa1f67..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.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.Monitor.MonitorWorkspace.Support -{ - - /// The current provisioning state. - public partial class PrivateEndpointConnectionProvisioningStateTypeConverter : - 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) => PrivateEndpointConnectionProvisioningState.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs deleted file mode 100644 index 598003e9e509..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs +++ /dev/null @@ -1,112 +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.Monitor.MonitorWorkspace.Support -{ - - /// The current provisioning state. - public partial struct PrivateEndpointConnectionProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateEndpointConnectionProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateEndpointConnectionProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateEndpointConnectionProvisioningState - /// 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.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateEndpointConnectionProvisioningState (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 PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); - } - - /// Returns hashCode for enum PrivateEndpointConnectionProvisioningState - /// 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 PrivateEndpointConnectionProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateEndpointConnectionProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to PrivateEndpointConnectionProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator PrivateEndpointConnectionProvisioningState(string value) - { - return new PrivateEndpointConnectionProvisioningState(value); - } - - /// - /// Implicit operator to convert PrivateEndpointConnectionProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateEndpointConnectionProvisioningState - /// 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.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateEndpointConnectionProvisioningState - /// 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.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointConnectionProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs deleted file mode 100644 index 3c0e4ae7ee4c..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs +++ /dev/null @@ -1,43 +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.Monitor.MonitorWorkspace.Support -{ - - /// The private endpoint connection status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatusTypeConverter))] - public partial struct PrivateEndpointServiceConnectionStatus : - 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) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Approved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Approved'", "Approved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approved"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rejected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Rejected'", "Rejected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rejected"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs deleted file mode 100644 index a9fc9ee84f16..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.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.Monitor.MonitorWorkspace.Support -{ - - /// The private endpoint connection status. - public partial class PrivateEndpointServiceConnectionStatusTypeConverter : - 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) => PrivateEndpointServiceConnectionStatus.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs deleted file mode 100644 index cfddb5bba01a..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs +++ /dev/null @@ -1,106 +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.Monitor.MonitorWorkspace.Support -{ - - /// The private endpoint connection status. - public partial struct PrivateEndpointServiceConnectionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus Approved = @"Approved"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus Rejected = @"Rejected"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateEndpointServiceConnectionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateEndpointServiceConnectionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateEndpointServiceConnectionStatus - /// 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.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateEndpointServiceConnectionStatus (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 PrivateEndpointServiceConnectionStatus && Equals((PrivateEndpointServiceConnectionStatus)obj); - } - - /// Returns hashCode for enum PrivateEndpointServiceConnectionStatus - /// 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 PrivateEndpointServiceConnectionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateEndpointServiceConnectionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PrivateEndpointServiceConnectionStatus - /// the value to convert to an instance of . - - public static implicit operator PrivateEndpointServiceConnectionStatus(string value) - { - return new PrivateEndpointServiceConnectionStatus(value); - } - - /// Implicit operator to convert PrivateEndpointServiceConnectionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateEndpointServiceConnectionStatus - /// 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.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateEndpointServiceConnectionStatus - /// 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.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PrivateEndpointServiceConnectionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.Completer.cs deleted file mode 100644 index 7171e078729e..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.Completer.cs +++ /dev/null @@ -1,53 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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) || "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) || "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) || "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) || "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"); - } - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs deleted file mode 100644 index e6c8674f0451..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs +++ /dev/null @@ -1,61 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// - 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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.cs deleted file mode 100644 index e134e87a3ee8..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/ProvisioningState.cs +++ /dev/null @@ -1,106 +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.Monitor.MonitorWorkspace.Support -{ - - /// - /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// - public partial struct ProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState Succeeded = @"Succeeded"; - - /// 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.ProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.Completer.cs deleted file mode 100644 index fea6377ee7e5..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.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.Monitor.MonitorWorkspace.Support -{ - - /// Gets or sets allow or disallow public network access to workspace - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccessTypeConverter))] - public partial struct PublicNetworkAccess : - 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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.TypeConverter.cs deleted file mode 100644 index 16d3df3863fe..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.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.Monitor.MonitorWorkspace.Support -{ - - /// Gets or sets allow or disallow public network access to workspace - public partial class PublicNetworkAccessTypeConverter : - 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) => PublicNetworkAccess.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/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.cs deleted file mode 100644 index c7513f699c0d..000000000000 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/api/Support/PublicNetworkAccess.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.Monitor.MonitorWorkspace.Support -{ - - /// Gets or sets allow or disallow public network access to workspace - public partial struct PublicNetworkAccess : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PublicNetworkAccess - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PublicNetworkAccess(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PublicNetworkAccess - /// 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.Monitor.MonitorWorkspace.Support.PublicNetworkAccess e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PublicNetworkAccess (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 PublicNetworkAccess && Equals((PublicNetworkAccess)obj); - } - - /// Returns hashCode for enum PublicNetworkAccess - /// 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 PublicNetworkAccess(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PublicNetworkAccess - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PublicNetworkAccess - /// the value to convert to an instance of . - - public static implicit operator PublicNetworkAccess(string value) - { - return new PublicNetworkAccess(value); - } - - /// Implicit operator to convert PublicNetworkAccess to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess e) - { - return e._value; - } - - /// Overriding != operator for enum PublicNetworkAccess - /// 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.Monitor.MonitorWorkspace.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PublicNetworkAccess - /// 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.Monitor.MonitorWorkspace.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support.PublicNetworkAccess e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_Get.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_Get.cs index deed04420005..f89b74e8b2de 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_Get.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; /// Returns the specific Azure Monitor workspace @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorWorkspace_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Returns the specific Azure Monitor workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class GetAzMonitorWorkspace_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzMonitorWorkspace_Get : 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 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzMonitorWorkspace_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -94,7 +115,7 @@ public partial class GetAzMonitorWorkspace_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -140,7 +161,8 @@ public partial class GetAzMonitorWorkspace_Get : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +171,24 @@ public partial class GetAzMonitorWorkspace_Get : 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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) @@ -189,6 +211,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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -210,7 +237,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorWorkspace_Get() { @@ -261,8 +288,33 @@ public GetAzMonitorWorkspace_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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -315,7 +367,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +388,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } }); @@ -374,12 +426,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -396,15 +448,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 } }); @@ -414,12 +466,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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 ) { @@ -431,8 +483,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_GetViaIdentity.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_GetViaIdentity.cs index 1c9744be4fa4..c40d545cb626 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_GetViaIdentity.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; /// Returns the specific Azure Monitor workspace @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorWorkspace_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Returns the specific Azure Monitor workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class GetAzMonitorWorkspace_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzMonitorWorkspace_GetViaIdentity : global::System.Manag /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzMonitorWorkspace_GetViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 GetAzMonitorWorkspace_GetViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 GetAzMonitorWorkspace_GetViaIdentity : global::System.Manag /// 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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.Monitor.MonitorWorkspace.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 GetAzMonitorWorkspace_GetViaIdentity() { @@ -222,8 +248,33 @@ public GetAzMonitorWorkspace_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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } }); @@ -352,12 +403,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -374,7 +425,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.Monitor.MonitorWorkspace.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } @@ -392,12 +443,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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List.cs index 9cc2547929b6..840c4a37ee62 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; /// Lists all workspaces in the specified resource group @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorWorkspace_List")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Lists all workspaces in the specified resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts", ApiVersion = "2023-04-03")] public partial class GetAzMonitorWorkspace_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzMonitorWorkspace_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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzMonitorWorkspace_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -85,7 +106,7 @@ public partial class GetAzMonitorWorkspace_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -131,7 +152,8 @@ public partial class GetAzMonitorWorkspace_List : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +162,24 @@ public partial class GetAzMonitorWorkspace_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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult /// 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) @@ -180,6 +202,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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -201,7 +228,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorWorkspace_List() { @@ -252,8 +279,33 @@ public GetAzMonitorWorkspace_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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -306,7 +358,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +379,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } }); @@ -365,12 +417,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -387,15 +439,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 } }); @@ -405,12 +457,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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult /// 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 ) { @@ -422,15 +474,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List1.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List1.cs index 13dffccae37d..9955ba4c4876 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List1.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/GetAzMonitorWorkspace_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; /// Lists all workspaces in the specified subscription @@ -13,13 +15,14 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Monitor/accounts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMonitorWorkspace_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Lists all workspaces in the specified subscription")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Monitor/accounts", ApiVersion = "2023-04-03")] public partial class GetAzMonitorWorkspace_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzMonitorWorkspace_List1 : global::System.Management.Aut /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzMonitorWorkspace_List1 : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -85,7 +106,7 @@ public partial class GetAzMonitorWorkspace_List1 : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -117,7 +138,8 @@ public partial class GetAzMonitorWorkspace_List1 : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +148,24 @@ public partial class GetAzMonitorWorkspace_List1 : global::System.Management.Aut /// 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult /// 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) @@ -166,6 +188,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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +214,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMonitorWorkspace_List1() { @@ -238,8 +265,33 @@ public GetAzMonitorWorkspace_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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +344,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } }); @@ -351,12 +403,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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,15 +425,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 } }); @@ -391,12 +443,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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult /// 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,15 +460,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceListResult + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateExpanded.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateExpanded.cs index 26fbe519e9d6..99cda41c6318 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateExpanded.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; - /// Create or update a workspace + /// create a workspace /// /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzMonitorWorkspace_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Create or update a workspace")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"create a workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class NewAzMonitorWorkspace_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,18 +34,33 @@ public partial class NewAzMonitorWorkspace_CreateExpanded : global::System.Manag private string __processRecordId; /// An Azure Monitor Workspace definition - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource(); /// /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class NewAzMonitorWorkspace_CreateExpanded : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -108,7 +129,7 @@ public partial class NewAzMonitorWorkspace_CreateExpanded : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -154,7 +175,8 @@ public partial class NewAzMonitorWorkspace_CreateExpanded : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -167,44 +189,44 @@ public partial class NewAzMonitorWorkspace_CreateExpanded : global::System.Manag ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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) @@ -227,6 +249,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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -291,8 +318,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -302,7 +354,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzMonitorWorkspace_CreateExpanded() { @@ -356,7 +408,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -369,12 +421,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AzureMonitorWorkspacesCreate(SubscriptionId, ResourceGroupName, Name, _azureMonitorWorkspacePropertiesBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesCreate(SubscriptionId, ResourceGroupName, Name, _azureMonitorWorkspacePropertiesBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody}) + 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 } }); @@ -410,12 +462,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -427,8 +479,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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; + } + } } } @@ -436,12 +506,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 +528,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.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody }) + 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 +546,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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 +563,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaIdentityExpanded.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaIdentityExpanded.cs index e394df108091..39059dc04626 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaIdentityExpanded.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaIdentityExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; - /// Create or update a workspace + /// create a workspace /// /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzMonitorWorkspace_CreateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Create or update a workspace")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"create a workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class NewAzMonitorWorkspace_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,18 +34,33 @@ public partial class NewAzMonitorWorkspace_CreateViaIdentityExpanded : global::S private string __processRecordId; /// An Azure Monitor Workspace definition - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResource(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResource(); /// /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class NewAzMonitorWorkspace_CreateViaIdentityExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -101,7 +122,7 @@ public partial class NewAzMonitorWorkspace_CreateViaIdentityExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -128,44 +149,44 @@ public partial class NewAzMonitorWorkspace_CreateViaIdentityExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api30.ITrackedResourceTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.ITrackedResourceTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated 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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 +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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -252,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -263,7 +314,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzMonitorWorkspace_CreateViaIdentityExpanded() { @@ -317,7 +368,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -332,7 +383,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.AzureMonitorWorkspacesCreateViaIdentity(InputObject.Id, _azureMonitorWorkspacePropertiesBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesCreateViaIdentity(InputObject.Id, _azureMonitorWorkspacePropertiesBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate); } else { @@ -349,13 +400,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureMonitorWorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.AzureMonitorWorkspacesCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureMonitorWorkspaceName ?? null, _azureMonitorWorkspacePropertiesBody, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesCreate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureMonitorWorkspaceName ?? null, _azureMonitorWorkspacePropertiesBody, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeCreate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_azureMonitorWorkspacePropertiesBody}) + 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 } }); @@ -391,12 +442,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -408,8 +459,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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; + } + } } } @@ -417,12 +486,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -439,15 +508,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.Monitor.MonitorWorkspace.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_azureMonitorWorkspacePropertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody }) + 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 } }); @@ -457,12 +526,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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 ) { @@ -474,8 +543,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaJsonFilePath.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..2194516977e2 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaJsonFilePath.cs @@ -0,0 +1,579 @@ +// 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.Monitor.MonitorWorkspace.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; + using System; + + /// create a workspace + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzMonitorWorkspace_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"create a workspace")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.NotSuggestDefaultParameterSet] + public partial class NewAzMonitorWorkspace_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Azure Monitor workspace. The name is case insensitive + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure Monitor workspace. The name is case insensitive")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure Monitor workspace. The name is case insensitive", + SerializedName = @"azureMonitorWorkspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AzureMonitorWorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 NewAzMonitorWorkspace_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AzureMonitorWorkspacesCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureMonitorWorkspacesCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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; + } + } + } + } + + /// + /// 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaJsonString.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaJsonString.cs new file mode 100644 index 000000000000..c6ae6559f5f1 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/NewAzMonitorWorkspace_CreateViaJsonString.cs @@ -0,0 +1,577 @@ +// 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.Monitor.MonitorWorkspace.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; + using System; + + /// create a workspace + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzMonitorWorkspace_CreateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"create a workspace")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.NotSuggestDefaultParameterSet] + public partial class NewAzMonitorWorkspace_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Azure Monitor workspace. The name is case insensitive + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure Monitor workspace. The name is case insensitive")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure Monitor workspace. The name is case insensitive", + SerializedName = @"azureMonitorWorkspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AzureMonitorWorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 NewAzMonitorWorkspace_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AzureMonitorWorkspacesCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureMonitorWorkspacesCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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; + } + } + } + } + + /// + /// 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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_Delete.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_Delete.cs index 1cce0657b4af..50a18c0509ab 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_Delete.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; /// Delete a workspace @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class RemoveAzMonitorWorkspace_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzMonitorWorkspace_Delete : 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(); + /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzMonitorWorkspace_Delete : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzMonitorWorkspace_Delete : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 +125,7 @@ public partial class RemoveAzMonitorWorkspace_Delete : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 +171,8 @@ public partial class RemoveAzMonitorWorkspace_Delete : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class RemoveAzMonitorWorkspace_Delete : 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 @@ -185,6 +198,16 @@ public partial class RemoveAzMonitorWorkspace_Delete : global::System.Management partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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) /// @@ -293,11 +316,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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"); @@ -309,10 +357,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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -380,7 +444,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -393,12 +457,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AzureMonitorWorkspacesDelete(SubscriptionId, ResourceGroupName, Name, onNoContent, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesDelete(SubscriptionId, ResourceGroupName, Name, onNoContent, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } }); @@ -411,7 +475,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzMonitorWorkspace_Delete() { @@ -444,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -466,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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 } }); @@ -499,7 +563,31 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_DeleteViaIdentity.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_DeleteViaIdentity.cs index 1aa86ed24cd2..09aa4565a821 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_DeleteViaIdentity.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/RemoveAzMonitorWorkspace_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; /// Delete a workspace @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : 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(); + /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 +118,7 @@ public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 +141,12 @@ public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : 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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 @@ -146,6 +158,16 @@ public partial class RemoveAzMonitorWorkspace_DeleteViaIdentity : global::System partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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) /// @@ -251,11 +273,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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"); @@ -267,10 +314,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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -353,7 +416,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.AzureMonitorWorkspacesDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesDeleteViaIdentity(InputObject.Id, onNoContent, onOk, onDefault, this, Pipeline); } else { @@ -370,13 +433,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureMonitorWorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.AzureMonitorWorkspacesDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureMonitorWorkspaceName ?? null, onNoContent, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureMonitorWorkspaceName ?? null, onNoContent, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } }); @@ -389,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzMonitorWorkspace_DeleteViaIdentity() { @@ -422,12 +485,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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -444,7 +507,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.Monitor.MonitorWorkspace.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 } @@ -477,7 +540,31 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// 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 == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateExpanded.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateExpanded.cs index f8fb2ac9ea38..8a74353508f4 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateExpanded.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; - /// Updates part of a workspace + /// update part of a workspace /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMonitorWorkspace_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Updates part of a workspace")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"update part of a workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class UpdateAzMonitorWorkspace_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,18 +34,33 @@ public partial class UpdateAzMonitorWorkspace_UpdateExpanded : global::System.Ma private string __processRecordId; /// Definition of ARM tracked top level resource properties for update operation - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdate(); /// /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class UpdateAzMonitorWorkspace_UpdateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -97,7 +118,7 @@ public partial class UpdateAzMonitorWorkspace_UpdateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -143,7 +164,8 @@ public partial class UpdateAzMonitorWorkspace_UpdateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -156,32 +178,32 @@ public partial class UpdateAzMonitorWorkspace_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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) @@ -204,6 +226,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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -268,8 +295,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -325,7 +377,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -338,12 +390,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AzureMonitorWorkspacesUpdate(SubscriptionId, ResourceGroupName, Name, _azureMonitorWorkspacePropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesUpdate(SubscriptionId, ResourceGroupName, Name, _azureMonitorWorkspacePropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody}) + 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 } }); @@ -363,7 +415,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzMonitorWorkspace_UpdateExpanded() { @@ -389,12 +441,12 @@ public UpdateAzMonitorWorkspace_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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -411,15 +463,15 @@ public UpdateAzMonitorWorkspace_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody }) + 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 } }); @@ -429,12 +481,12 @@ public UpdateAzMonitorWorkspace_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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 ) { @@ -446,8 +498,26 @@ public UpdateAzMonitorWorkspace_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded.cs index 1462ece962d5..6c2e1b21f339 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded.cs @@ -6,20 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; using System; - /// Updates part of a workspace + /// update part of a workspace /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMonitorWorkspace_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties=new string[] {"PrivateEndpointConnection","ProvisioningState"}, ChangeDescription="The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"Updates part of a workspace")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"update part of a workspace")] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] public partial class UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,18 +34,33 @@ public partial class UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded : global private string __processRecordId; /// Definition of ARM tracked top level resource properties for update operation - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdate _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.AzureMonitorWorkspaceResourceForUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdate _azureMonitorWorkspacePropertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.AzureMonitorWorkspaceResourceForUpdate(); /// /// 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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.ClientAPI; @@ -56,6 +74,9 @@ public partial class UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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] @@ -90,7 +111,7 @@ public partial class UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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")] @@ -117,32 +138,32 @@ public partial class UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResourceForUpdateTags Tag { get => _azureMonitorWorkspacePropertiesBody.Tag ?? null /* object */; set => _azureMonitorWorkspacePropertiesBody.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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 +186,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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -229,8 +255,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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -286,7 +337,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -301,7 +352,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.AzureMonitorWorkspacesUpdateViaIdentity(InputObject.Id, _azureMonitorWorkspacePropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesUpdateViaIdentity(InputObject.Id, _azureMonitorWorkspacePropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate); } else { @@ -318,13 +369,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AzureMonitorWorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.AzureMonitorWorkspacesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureMonitorWorkspaceName ?? null, _azureMonitorWorkspacePropertiesBody, onOk, onDefault, this, Pipeline); + await this.Client.AzureMonitorWorkspacesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.AzureMonitorWorkspaceName ?? null, _azureMonitorWorkspacePropertiesBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_azureMonitorWorkspacePropertiesBody}) + 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 } }); @@ -344,7 +395,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded() { @@ -370,12 +421,12 @@ public UpdateAzMonitorWorkspace_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.Monitor.MonitorWorkspace.Models.Api30.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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 ) { @@ -392,15 +443,15 @@ public UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_azureMonitorWorkspacePropertiesBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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=_azureMonitorWorkspacePropertiesBody }) + 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 } }); @@ -410,12 +461,12 @@ public UpdateAzMonitorWorkspace_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.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource /// 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 ) { @@ -427,8 +478,26 @@ public UpdateAzMonitorWorkspace_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.Api20230403.IAzureMonitorWorkspaceResource - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaJsonFilePath.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..cef2fd53c840 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaJsonFilePath.cs @@ -0,0 +1,525 @@ +// 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.Monitor.MonitorWorkspace.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; + using System; + + /// update part of a workspace + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMonitorWorkspace_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"update part of a workspace")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.NotSuggestDefaultParameterSet] + public partial class UpdateAzMonitorWorkspace_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Azure Monitor workspace. The name is case insensitive + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure Monitor workspace. The name is case insensitive")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure Monitor workspace. The name is case insensitive", + SerializedName = @"azureMonitorWorkspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AzureMonitorWorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AzureMonitorWorkspacesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureMonitorWorkspacesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzMonitorWorkspace_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaJsonString.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaJsonString.cs new file mode 100644 index 000000000000..9bf112e95213 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/cmdlets/UpdateAzMonitorWorkspace_UpdateViaJsonString.cs @@ -0,0 +1,523 @@ +// 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.Monitor.MonitorWorkspace.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Cmdlets; + using System; + + /// update part of a workspace + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzMonitorWorkspace_UpdateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource", "15.0.0", "7.0.0", "2025/11/03", DeprecatedOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState"}, NewOutputProperties = new string[] {"PrivateEndpointConnection","ProvisioningState" } , ChangeDescription = "The types of the properties PrivateEndpointConnection and ProvisioningState will be changed from single object or fixed array to 'List'.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Description(@"update part of a workspace")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}", ApiVersion = "2023-04-03")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.NotSuggestDefaultParameterSet] + public partial class UpdateAzMonitorWorkspace_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.MonitorWorkspace Client => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Azure Monitor workspace. The name is case insensitive + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Azure Monitor workspace. The name is case insensitive")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Azure Monitor workspace. The name is case insensitive", + SerializedName = @"azureMonitorWorkspaceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AzureMonitorWorkspaceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AzureMonitorWorkspacesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AzureMonitorWorkspacesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzMonitorWorkspace_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + /// 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.Monitor.MonitorWorkspace.Models.IAzureMonitorWorkspaceResource + 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/Monitor/MonitorWorkspace.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..7489560820e9 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace +{ + 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/Monitor/MonitorWorkspace.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..ab9ff1bd8b8d --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace +{ + 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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index fa78e12c1173..c4846ec0dea0 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index c51209136051..47f86f2969ac 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index d890f1a171be..93c4d3d6da3d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 9932b9b7e500..9120fd55ce0d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 4abd63cef690..a58c14d6ba3a 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index d4cc1217c413..061a58424b25 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 8f1a80074081..900988c5a2d3 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -36,14 +36,23 @@ internal class PsHelpInfo public object Role { get; } public string NonTerminatingErrors { get; } + public static string CapitalizeFirstLetter(string text) + { + if (string.IsNullOrEmpty(text)) + return text; + + return char.ToUpper(text[0]) + text.Substring(1); + } + public PsHelpInfo(PSObject helpObject = null) { helpObject = helpObject ?? new PSObject(); CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); ModuleName = helpObject.GetProperty("ModuleName"); - Synopsis = helpObject.GetProperty("Synopsis"); + Synopsis = CapitalizeFirstLetter(helpObject.GetProperty("Synopsis")); Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + Description = CapitalizeFirstLetter(Description); AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); Category = helpObject.GetProperty("Category"); HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 0333739a317b..3ec311c7ad7d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 70c2bcde055b..4cc2d57fd79e 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/MonitorWorkspace.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,20 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +262,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.Monitor.MonitorWorkspace.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 +305,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.Monitor.MonitorWorkspace.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 +324,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 +422,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 +436,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +630,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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 9cb96c626977..9ca63f5e0ece 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"Az.Monitor";} + public string RootModuleName { get => @"Az.Monitor"; } 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/"; @@ -374,6 +392,7 @@ public CommentInfo(VariantGroup variantGroup) var helpInfo = variantGroup.HelpInfo; Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() ?? helpInfo.Description.EmptyIfNull(); + Description = PsHelpInfo.CapitalizeFirstLetter(Description); // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; Synopsis = synopsis.NullIfEmpty() ?? Description; @@ -391,6 +410,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 +442,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 +465,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +513,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 +542,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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 5181e5a2c3c5..cba482509035 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 57178ed6c9f4..ce66031de8e3 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime.Po { 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/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsHelpers.cs index bb21e1fd4722..a58e63692d64 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/Context.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..4dd0cc538066 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParameters, 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.Monitor.MonitorWorkspace.MonitorWorkspace Client { get; } + } +} diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Events.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Events.cs index d7796552e0eb..269440c1e9cf 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Events.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/ISendAsync.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/ISendAsync.cs index beb99d0a9d9c..bdcd27a5df5a 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/InfoAttribute.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/InfoAttribute.cs index 9136b06ec738..447701e959e8 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/InputHandler.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..c8872de728e9 --- /dev/null +++ b/generated/Monitor/MonitorWorkspace.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.Monitor.MonitorWorkspace.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.Monitor.MonitorWorkspace.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/MessageAttribute.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/MessageAttribute.cs index 9145e82cba6e..81ffd44aef50 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.MonitorWorkspace.Runtime public class GenericBreakingChangeAttribute : Attribute { private string _message; - //A dexcription of what the change is about, non mandatory + //A description of what the change is about, non mandatory public string ChangeDescription { get; set; } = null; + //Name of the module that is being deprecated + public string moduleName { get; set; } = String.IsNullOrEmpty(@"Az.Monitor") ? @"Az.MonitorWorkspace" : @"Az.Monitor"; + //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } public string DeprecateByAzVersion { get; } @@ -82,7 +85,7 @@ public void PrintCustomAttributeInfo(Action writeOutput) } writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.moduleName, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -191,11 +194,11 @@ public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this( this.IsEstimatedGaDateSet = true; } } - + public void PrintCustomAttributeInfo(Action writeOutput) { writeOutput(this._message); - + if (IsEstimatedGaDateSet) { writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 5806e8afd568..b9b0b78b5bc4 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/Properties/Resources.resx b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from version : '{0}' +- The change is expected to take effect in '{0}' from version : '{1}' ```powershell diff --git a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/SerializationMode.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/SerializationMode.cs index 58bf638f3713..5b568b3ba9ee 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/TypeConverterExtensions.cs index 2c2dfdf4b2a3..bd2d9db36d7c 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Monitor/MonitorWorkspace.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/Monitor/MonitorWorkspace.Autorest/test-module.ps1 b/generated/Monitor/MonitorWorkspace.Autorest/test-module.ps1 index 12f5e911f25b..86925e86d7f6 100644 --- a/generated/Monitor/MonitorWorkspace.Autorest/test-module.ps1 +++ b/generated/Monitor/MonitorWorkspace.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-------------' diff --git a/generated/Monitor/PipelineGroup.Autorest/exports/Get-AzPipelineGroup.ps1 b/generated/Monitor/PipelineGroup.Autorest/exports/Get-AzPipelineGroup.ps1 index 602d7b9e55a3..df1006672b97 100644 --- a/generated/Monitor/PipelineGroup.Autorest/exports/Get-AzPipelineGroup.ps1 +++ b/generated/Monitor/PipelineGroup.Autorest/exports/Get-AzPipelineGroup.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/PipelineGroup.Autorest/exports/New-AzPipelineGroup.ps1 b/generated/Monitor/PipelineGroup.Autorest/exports/New-AzPipelineGroup.ps1 index d5ed350dadad..6ba6ea6e671a 100644 --- a/generated/Monitor/PipelineGroup.Autorest/exports/New-AzPipelineGroup.ps1 +++ b/generated/Monitor/PipelineGroup.Autorest/exports/New-AzPipelineGroup.ps1 @@ -273,8 +273,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/PipelineGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/PipelineGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 index 53ceb4b6b0bb..55443172dd3b 100644 --- a/generated/Monitor/PipelineGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/PipelineGroup.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -484,8 +483,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -709,8 +707,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1061,8 +1058,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/PipelineGroup.Autorest/exports/Remove-AzPipelineGroup.ps1 b/generated/Monitor/PipelineGroup.Autorest/exports/Remove-AzPipelineGroup.ps1 index 06174a4da0fa..7fc8c1bad9f4 100644 --- a/generated/Monitor/PipelineGroup.Autorest/exports/Remove-AzPipelineGroup.ps1 +++ b/generated/Monitor/PipelineGroup.Autorest/exports/Remove-AzPipelineGroup.ps1 @@ -153,8 +153,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/PipelineGroup.Autorest/exports/Update-AzPipelineGroup.ps1 b/generated/Monitor/PipelineGroup.Autorest/exports/Update-AzPipelineGroup.ps1 index d40695c9655d..9505ac1f6d2c 100644 --- a/generated/Monitor/PipelineGroup.Autorest/exports/Update-AzPipelineGroup.ps1 +++ b/generated/Monitor/PipelineGroup.Autorest/exports/Update-AzPipelineGroup.ps1 @@ -281,8 +281,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/Module.cs b/generated/Monitor/PipelineGroup.Autorest/generated/Module.cs index 77abf670cf4e..0fc99a740f68 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/Module.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/Module.cs @@ -68,7 +68,7 @@ public partial class Module public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.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.PipelineGroup"; + public string Name => @"Az.Monitor"; /// The delegate to call when this module is loaded (supporting a commmon module). public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } @@ -80,7 +80,7 @@ public partial class Module public global::System.String ProfileName { get; set; } /// The ResourceID for this module (azure arm). - public string ResourceId => @"Az.PipelineGroup"; + public string ResourceId => @"Az.Monitor"; /// The delegate to call in WriteObject to sanitize the output object. public SanitizerDelegate SanitizeOutput { get; set; } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateExpanded.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateExpanded.cs index eb1e6a5d1034..dd20b71baa54 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateExpanded.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateExpanded.cs @@ -40,18 +40,9 @@ public partial class NewAzPipelineGroup_CreateExpanded : global::System.Manageme /// 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 pipeline group definition. private Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup _resourceBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.PipelineGroup(); - /// - /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -378,11 +369,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.NewAzPip /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -698,24 +684,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonFilePath.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonFilePath.cs index 3b433f459832..0cb45c7f8b95 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonFilePath.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonFilePath.cs @@ -41,17 +41,8 @@ public partial class NewAzPipelineGroup_CreateViaJsonFilePath : global::System.M /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -263,11 +254,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.NewAzPip /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -583,24 +569,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonString.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonString.cs index 6582bc23c6cc..021ea61e83d9 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonString.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/NewAzPipelineGroup_CreateViaJsonString.cs @@ -41,15 +41,6 @@ public partial class NewAzPipelineGroup_CreateViaJsonString : global::System.Man /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -261,11 +252,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.NewAzPip /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -581,24 +567,7 @@ protected override void StopProcessing() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_Delete.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_Delete.cs index d7877cb1aac4..53142c4960be 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_Delete.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_Delete.cs @@ -40,15 +40,6 @@ public partial class RemoveAzPipelineGroup_Delete : global::System.Management.Au /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -261,11 +252,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.RemoveAz /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -577,7 +563,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -601,7 +587,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_DeleteViaIdentity.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_DeleteViaIdentity.cs index 829f6d853f71..aecfa42f2ec6 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_DeleteViaIdentity.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/RemoveAzPipelineGroup_DeleteViaIdentity.cs @@ -40,15 +40,6 @@ public partial class RemoveAzPipelineGroup_DeleteViaIdentity : global::System.Ma /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -218,11 +209,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.RemoveAz /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -554,7 +540,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -578,7 +564,7 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateExpanded.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateExpanded.cs index 5e679ac9bb1b..f143d4d29927 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateExpanded.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateExpanded.cs @@ -40,18 +40,9 @@ public partial class UpdateAzPipelineGroup_UpdateExpanded : global::System.Manag /// 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 pipeline group definition. private Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroupUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.PipelineGroupUpdate(); - /// - /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -344,11 +335,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.UpdateAz /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -664,24 +650,7 @@ public UpdateAzPipelineGroup_UpdateExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaIdentityExpanded.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaIdentityExpanded.cs index b08ea1d00f00..bf8c23171d22 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaIdentityExpanded.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaIdentityExpanded.cs @@ -40,18 +40,9 @@ public partial class UpdateAzPipelineGroup_UpdateViaIdentityExpanded : global::S /// 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 pipeline group definition. private Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroupUpdate _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.PipelineGroupUpdate(); - /// - /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -301,11 +292,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.UpdateAz /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -641,24 +627,7 @@ public UpdateAzPipelineGroup_UpdateViaIdentityExpanded() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonFilePath.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonFilePath.cs index 48814765c373..4d36495f11d7 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonFilePath.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonFilePath.cs @@ -41,17 +41,8 @@ public partial class UpdateAzPipelineGroup_UpdateViaJsonFilePath : global::Syste /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -263,11 +254,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.UpdateAz /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -583,24 +569,7 @@ public UpdateAzPipelineGroup_UpdateViaJsonFilePath() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonString.cs b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonString.cs index c8297a855db7..1122df207303 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonString.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/cmdlets/UpdateAzPipelineGroup_UpdateViaJsonString.cs @@ -41,15 +41,6 @@ public partial class UpdateAzPipelineGroup_UpdateViaJsonString : global::System. /// 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.Monitor.PipelineGroup.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.ParameterCategory.Runtime)] @@ -261,11 +252,6 @@ public Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Cmdlets.UpdateAz /// Performs clean-up after the command execution protected override void EndProcessing() { - if (1 ==_responseSize) - { - // Flush buffer - WriteObject(_firstResponse); - } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -581,24 +567,7 @@ public UpdateAzPipelineGroup_UpdateViaJsonString() // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Models.IPipelineGroup 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; - } - } + WriteObject(result, false); } } } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/PipelineGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 77429f6d9952..e972dcf0958b 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/Monitor/PipelineGroup.Autorest/generated/runtime/Context.cs b/generated/Monitor/PipelineGroup.Autorest/generated/runtime/Context.cs index 88d91480c221..1d8b8dd26562 100644 --- a/generated/Monitor/PipelineGroup.Autorest/generated/runtime/Context.cs +++ b/generated/Monitor/PipelineGroup.Autorest/generated/runtime/Context.cs @@ -20,7 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.PipelineGroup.Runtime /// The IContext Interface defines the communication mechanism for input customization. /// /// - /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// In the context, we will have client, pipeline, PSBoundParameters, default EventListener, Cancellation. /// public interface IContext { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 index 4a051a847efd..bee1e1c98144 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Get-AzScheduledQueryRule.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 index ba287756b762..b01b9bfc3e8d 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/New-AzScheduledQueryRule.ps1 @@ -285,8 +285,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 index 3db7be575590..8db148ad6d2f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -496,8 +495,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -705,8 +703,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1082,8 +1079,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 index f04b5f0f1249..f54ec7a98566 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Remove-AzScheduledQueryRule.ps1 @@ -137,8 +137,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 index 065271f04069..6e42b8ec712f 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 +++ b/generated/Monitor/ScheduledQueryRule.Autorest/exports/Update-AzScheduledQueryRule.ps1 @@ -306,8 +306,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 93c06496c043..f3fcf554f1e4 100644 --- a/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Monitor/ScheduledQueryRule.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 index ca70ac9fee3c..82bbe0be0f0d 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 @@ -163,8 +163,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewall.ps1 index 5076c825560a..d47f2137e595 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewall.ps1 @@ -143,8 +143,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallLogProfile.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallLogProfile.ps1 index b8d0f33b90a5..b0cf6f59804a 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallLogProfile.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallLogProfile.ps1 @@ -135,8 +135,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallStatus.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallStatus.ps1 index 834084697d07..99ddc117a94e 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallStatus.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFirewallStatus.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 index d51b902556d2..14916a576597 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 @@ -163,8 +163,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRule.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRule.ps1 index 68eb5eb3f40c..4d179d946b92 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRule.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRule.ps1 @@ -163,8 +163,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestack.ps1 index 6f42e27defba..4ddeefdb9629 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestack.ps1 @@ -143,8 +143,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackAppId.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackAppId.ps1 index 7acb13252a2e..3d0eb25f55cb 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackAppId.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackAppId.ps1 @@ -137,8 +137,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackChangeLog.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackChangeLog.ps1 index 5896fb8adf26..2d8ca7545881 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackChangeLog.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackChangeLog.ps1 @@ -135,8 +135,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackFirewall.ps1 index 95d9152132d2..09bf95d22e0b 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackFirewall.ps1 @@ -113,8 +113,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackSupportInfo.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackSupportInfo.ps1 index 92c294d545dc..fc187e3eb0c7 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackSupportInfo.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksLocalRulestackSupportInfo.ps1 @@ -141,8 +141,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksMetricsObjectFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksMetricsObjectFirewall.ps1 index 88a0fd8c9118..c90965211850 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksMetricsObjectFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksMetricsObjectFirewall.ps1 @@ -138,8 +138,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationCloudManagerTenant.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationCloudManagerTenant.ps1 index 72c15d9da84d..e67e2d20dfc2 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationCloudManagerTenant.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationCloudManagerTenant.ps1 @@ -100,8 +100,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumberStatus.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumberStatus.ps1 index 153f06882bff..a1b6836fcf52 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumberStatus.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumberStatus.ps1 @@ -106,8 +106,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationSupportInfo.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationSupportInfo.ps1 index 3a265a05ba33..36e0f75e4822 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationSupportInfo.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationSupportInfo.ps1 @@ -100,8 +100,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 index 9382e7ce56f8..2c7bf39117a6 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Get-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 @@ -163,8 +163,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksCommitLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksCommitLocalRulestack.ps1 index 64c36fa45422..9db31bac0d90 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksCommitLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksCommitLocalRulestack.ps1 @@ -153,8 +153,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksRevertLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksRevertLocalRulestack.ps1 index 1cfe30ba0dfa..013e5d09930c 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksRevertLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Invoke-AzPaloAltoNetworksRevertLocalRulestack.ps1 @@ -141,8 +141,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 index 209998218e67..0f9245f12037 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 @@ -162,8 +162,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFirewall.ps1 index e8c3ebcdcedd..a4b43db1f8a8 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFirewall.ps1 @@ -328,8 +328,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 index 34abbfc309a9..dd3f01c8af62 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 @@ -156,8 +156,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRule.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRule.ps1 index 981013dc3891..39a147f3c3b5 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRule.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRule.ps1 @@ -315,8 +315,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRulestack.ps1 index 5b0489a6a219..8e347da2cbc4 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksLocalRulestack.ps1 @@ -248,8 +248,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksMetricsObjectFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksMetricsObjectFirewall.ps1 index 1b7dc14305e4..b77dca43e785 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksMetricsObjectFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksMetricsObjectFirewall.ps1 @@ -143,8 +143,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumber.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumber.ps1 index 2e8d5f99c0a7..05601ed5e424 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumber.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPaloAltoNetworksCloudngfwOperationProductSerialNumber.ps1 @@ -100,8 +100,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 index b2927443ce22..af4589f70691 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/New-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 @@ -156,8 +156,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/ProxyCmdletDefinitions.ps1 index ad8f02383e07..565ad0560429 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -163,8 +163,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -371,8 +370,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -580,8 +578,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -795,8 +792,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1031,8 +1027,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1241,8 +1236,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1446,8 +1440,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1630,8 +1623,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -1841,8 +1833,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2055,8 +2046,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2291,8 +2281,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2502,8 +2491,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2674,8 +2662,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -2850,8 +2837,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3020,8 +3006,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3253,8 +3238,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3479,8 +3463,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3691,8 +3674,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -3924,8 +3906,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4322,8 +4303,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4548,8 +4528,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -4866,8 +4845,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5251,8 +5229,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5464,8 +5441,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5634,8 +5610,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -5860,8 +5835,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -6106,8 +6080,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -6332,8 +6305,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -6579,8 +6551,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -6805,8 +6776,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -7052,8 +7022,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -7277,8 +7246,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -7524,8 +7492,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -7760,8 +7727,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -8311,8 +8277,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -8551,8 +8516,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -8792,8 +8756,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -9033,8 +8996,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { @@ -9251,8 +9213,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 index 49266f0aa534..826148a64676 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksCertificateObjectLocalRulestack.ps1 @@ -176,8 +176,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFirewall.ps1 index 5f6bb570f974..783b40e4a7d2 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFirewall.ps1 @@ -154,8 +154,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 index 911e4558fb8b..8ad4c8cee3b3 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksFqdnListLocalRulestack.ps1 @@ -176,8 +176,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRule.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRule.ps1 index 9c6ad593284c..8b5556ec2c23 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRule.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRule.ps1 @@ -176,8 +176,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRulestack.ps1 index 5019c6ed4143..e9e67ce9dfe7 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksLocalRulestack.ps1 @@ -154,8 +154,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksMetricsObjectFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksMetricsObjectFirewall.ps1 index 641a15d62d7a..969073dc7073 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksMetricsObjectFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksMetricsObjectFirewall.ps1 @@ -153,8 +153,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 index 82e942bb9a1f..06a332e5d89a 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Remove-AzPaloAltoNetworksPrefixListLocalRulestack.ps1 @@ -176,8 +176,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Reset-AzPaloAltoNetworksLocalRuleCounter.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Reset-AzPaloAltoNetworksLocalRuleCounter.ps1 index d424b47df7a3..48b3c6a68b36 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Reset-AzPaloAltoNetworksLocalRuleCounter.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Reset-AzPaloAltoNetworksLocalRuleCounter.ps1 @@ -164,8 +164,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Save-AzPaloAltoNetworksFirewallLogProfile.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Save-AzPaloAltoNetworksFirewallLogProfile.ps1 index b4d158ffca0f..286c7aa0d412 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Save-AzPaloAltoNetworksFirewallLogProfile.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Save-AzPaloAltoNetworksFirewallLogProfile.ps1 @@ -479,8 +479,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksFirewall.ps1 index 06f29705a585..cc0afe033802 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksFirewall.ps1 @@ -169,8 +169,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRuleCounter.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRuleCounter.ps1 index 40511d778949..128d82fa4d2e 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRuleCounter.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRuleCounter.ps1 @@ -170,8 +170,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRulestack.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRulestack.ps1 index 818864654a35..4c599ac6b800 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRulestack.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksLocalRulestack.ps1 @@ -169,8 +169,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksMetricsObjectFirewall.ps1 b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksMetricsObjectFirewall.ps1 index 2d098327eb00..0ccc6cf2825d 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksMetricsObjectFirewall.ps1 +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/exports/Update-AzPaloAltoNetworksMetricsObjectFirewall.ps1 @@ -147,8 +147,7 @@ begin { $context = Get-AzContext if (-not $context -and -not $testPlayback) { - Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." - exit + throw "No Azure login detected. Please run 'Connect-AzAccount' to log in." } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { diff --git a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index be70fe5fcb43..6809f2702d3b 100644 --- a/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/PaloAltoNetworks/PaloAltoNetworks.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -218,13 +218,12 @@ public string GetProcessCustomAttributesAtRuntime() private string GetLoginVerification() { - if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + 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}{Indent}throw ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" {Indent}{Indent}}} "; } diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/Properties/AssemblyInfo.cs b/src/DynatraceObservability/DynatraceObservability.Autorest/Properties/AssemblyInfo.cs index 3c8e8a3122b1..039a8d3c046b 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/Properties/AssemblyInfo.cs +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DynatraceObservability")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("0.3.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("0.3.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] -[assembly: System.CLSCompliantAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/custom/Az.DynatraceObservability.custom.psm1 b/src/DynatraceObservability/DynatraceObservability.Autorest/custom/Az.DynatraceObservability.custom.psm1 index 184cf37ed795..29144135d88f 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/custom/Az.DynatraceObservability.custom.psm1 +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/custom/Az.DynatraceObservability.custom.psm1 @@ -1,9 +1,9 @@ # region Generated # Load the private module dll - $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.DynatraceObservability.private.dll') + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DynatraceObservability.private.dll') # Load the internal module - $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.DynatraceObservability.internal.psm1' + $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.DynatraceObservability.internal.psm1' if(Test-Path $internalModulePath) { $null = Import-Module -Name $internalModulePath } diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/custom/README.md b/src/DynatraceObservability/DynatraceObservability.Autorest/custom/README.md index 9d24a95620f7..58577378e1d8 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/custom/README.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/custom/README.md @@ -1,5 +1,5 @@ # Custom -This directory contains custom implementation for non-generated cmdlets for the `Az.DynatraceObservability` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.DynatraceObservability.custom.psm1`. This file should not be modified. +This directory contains custom implementation for non-generated cmdlets for the `Az.DynatraceObservability` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.DynatraceObservability.custom.psm1`. This file should not be modified. ## Info - Modifiable: yes @@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle For script cmdlets, these are loaded via the `Az.DynatraceObservability.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. ## Purpose -This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. ## Usage -The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: - Break - DefaultProfile - HttpPipelineAppend @@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes: - `Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.DoNotExportAttribute` - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.DynatraceObservability`. - `Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.InternalExportAttribute` - - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.DynatraceObservability`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.DynatraceObservability`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder. - `Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.ProfileAttribute` - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Az.DynatraceObservability.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Az.DynatraceObservability.md index 79c966b8df6a..716a19d4d711 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Az.DynatraceObservability.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Az.DynatraceObservability.md @@ -1,6 +1,6 @@ --- Module Name: Az.DynatraceObservability -Module Guid: eada85a3-a8b1-4fc1-b953-defbdf14917f +Module Guid: 253e7e4a-d526-46b7-a02b-3a70032974a1 Download Help Link: https://learn.microsoft.com/powershell/module/az.dynatraceobservability Help Version: 1.0.0.0 Locale: en-US diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Get-AzDynatraceMonitoredSubscription.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Get-AzDynatraceMonitoredSubscription.md index 8d7664d28a7a..c005d18e7e85 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Get-AzDynatraceMonitoredSubscription.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Get-AzDynatraceMonitoredSubscription.md @@ -35,21 +35,105 @@ List the subscriptions currently being monitored by the Dynatrace monitor resour ## EXAMPLES -### Example 1: List all monitored subscriptions for a Dynatrace monitor +### Example 1: List monitored subscriptions for a monitor ```powershell -$subs = Get-AzDynatraceMonitoredSubscription -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -$subs +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$subs = Get-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor +$subs | Select-Object Id, Name, Type ``` -Returns all subscription monitoring entries (status, subscriptionId, log/metric rule flags) for the specified Dynatrace monitor resource. +```output +Id Name Type +-- ---- ---- +/subscriptions/b16e4b4e-2ed8-4f32-bac1-0e3eb56bef5c/resourceGroups/dyobrg45en7g/providers/Dynatrace.Observability/monitors/dyob83ctr7/monitoredSubscriptions/default default Dynatrace.Observability/monitors/monitoredSubscriptions +``` + +Displays monitored subscription entries attached to the specified monitor. +(Sample output based on recording.) + +### Example 2: Use identity pipeline (monitor object) +```powershell +$monitorObj = Get-AzDynatraceMonitor -ResourceGroupName "myResourceGroup" -Name "myDynatraceMonitor" | Select-Object -First 1 +$monitorObj | Get-AzDynatraceMonitoredSubscription | Select-Object -First 1 -Property Id, Name +``` + +```output +Id Name +-- ---- +/subscriptions/b16e4b4e-2ed8-4f32-bac1-0e3eb56bef5c/resourceGroups/dyobrg45en7g/providers/Dynatrace.Observability/monitors/dyob83ctr7/monitoredSubscriptions/default default +``` + +Pipes the monitor object (identity) to retrieve its monitored subscriptions. + +### Example 3: Retrieve a single monitored subscription (Get parameter set) +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor" +$all = Get-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor +($all[0] | Get-AzDynatraceMonitoredSubscription) | Format-List Id, Name, Type, Properties +``` + +```output +Id : /subscriptions/b16e4b4e-2ed8-4f32-bac1-0e3eb56bef5c/resourceGroups/dyobrg45en7g/providers/Dynatrace.Observability/monitors/dyob83ctr7/monitoredSubscriptions/default +Name : default +Type : Dynatrace.Observability/monitors/monitoredSubscriptions +Properties : @{operation=AddBegin; monitoredSubscriptionList=} +``` + +Selects the first monitored subscription and re-fetches it for detailed inspection (properties show operation AddBegin). + +### Example 4: Filter for current subscription +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor"; $currentSub = (Get-AzContext).Subscription.Id +$subs = Get-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor | Where-Object { $_.Id -like "/subscriptions/$currentSub/*" } +$subs | Select-Object Id, Name +``` -### Example 2: Retrieve monitoring status for a specific subscription +```output +Id Name +-- ---- +/subscriptions/b16e4b4e-2ed8-4f32-bac1-0e3eb56bef5c/resourceGroups/dyobrg45en7g/providers/Dynatrace.Observability/monitors/dyob83ctr7/monitoredSubscriptions/default default +``` + +Filters results to the current subscription scope. + +### Example 5: Count monitored subscriptions +```powershell +$count = (Get-AzDynatraceMonitoredSubscription -ResourceGroupName "myResourceGroup" -MonitorName "myDynatraceMonitor").Count +Write-Host "Total monitored subscriptions: $count" +``` + +```output +Total monitored subscriptions: 1 +``` + +Outputs a simple count for reporting or validation. + +### Example 6: Graceful handling when none exist ```powershell -$subId = (Get-AzContext).Subscription.Id -Get-AzDynatraceMonitoredSubscription -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -SubscriptionId $subId +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor" +$subs = Get-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -ErrorAction SilentlyContinue +if (-not $subs -or $subs.Count -eq 0) { Write-Warning "No monitored subscriptions found." } else { $subs | Select-Object -First 5 } +``` + +```output +WARNING: No monitored subscriptions found. +``` + +Demonstrates defensive pattern when list may be empty. + +### Example 7: Format output for auditing +```powershell +Get-AzDynatraceMonitoredSubscription -ResourceGroupName "myResourceGroup" -MonitorName "myDynatraceMonitor" | + Select-Object Id,@{n='SubscriptionGuid';e={ ($_).Id.Split('/')[2] }}, Name | Export-Csv -Path monitoredSubs.csv -NoTypeInformation +``` + +```output +"Id","SubscriptionGuid","Name" +"/subscriptions/b16e4b4e-2ed8-4f32-bac1-0e3eb56bef5c/resourceGroups/dyobrg45en7g/providers/Dynatrace.Observability/monitors/dyob83ctr7/monitoredSubscriptions/default","b16e4b4e-2ed8-4f32-bac1-0e3eb56bef5c","default" ``` -Filters the result to the provided subscription Id to quickly inspect its monitoring status and related rule settings. +Prepares a CSV of monitored subscriptions with extracted subscription GUIDs for audit or inventory. ## PARAMETERS diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Invoke-AzDynatraceManageMonitorAgentInstallation.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Invoke-AzDynatraceManageMonitorAgentInstallation.md index b94561f5cb6b..a3bedd684a0f 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Invoke-AzDynatraceManageMonitorAgentInstallation.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Invoke-AzDynatraceManageMonitorAgentInstallation.md @@ -59,36 +59,78 @@ Performs Dynatrace agent install/uninstall action through the Azure Dynatrace re ## EXAMPLES -### Example 1: Install Dynatrace agent on a VM using a request object +### Example 1: Install agent on a VM using expanded parameters ```powershell -$subId = (Get-AzContext).Subscription.Id -$vmId = "/subscriptions/$subId/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/appvm1" +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/$rg/providers/Microsoft.Compute/virtualMachines/myVm01" +$entry = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentList]::new(); $entry.Id = $vmId +Invoke-AzDynatraceManageMonitorAgentInstallation -ResourceGroupName $rg -MonitorName $monitor -Action Install -ManageAgentInstallationList @($entry) -PassThru +``` -$request = New-Object Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentInstallationRequest -$request.Action = "Install" -$vmEntry = New-Object Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentList -$vmEntry.Id = $vmId -$request.ManageAgentInstallationList = @($vmEntry) +Returns True when the install request is accepted. -Invoke-AzDynatraceManageMonitorAgentInstallation -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -Request $request -PassThru +### Example 2: Uninstall agent via expanded parameters +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor" +$vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/$rg/providers/Microsoft.Compute/virtualMachines/myVm01" +$entry = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentList]::new(); $entry.Id = $vmId +Invoke-AzDynatraceManageMonitorAgentInstallation -ResourceGroupName $rg -MonitorName $monitor -Action Uninstall -ManageAgentInstallationList @($entry) -PassThru ``` -Creates a ManageAgentInstallationRequest to install the Dynatrace agent on the specified virtual machine and invokes the operation. PassThru returns true on success. +Removes the Dynatrace agent from the specified resource. -### Example 2: Uninstall Dynatrace agent using a JSON string +### Example 3: Use request object (Manage parameter set) ```powershell -$subId = (Get-AzContext).Subscription.Id -$json = @{ - action = "Uninstall"; - manageAgentInstallationList = @( - @{ id = "/subscriptions/$subId/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/appvm1" } - ) -} | ConvertTo-Json -Depth 5 +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor"; $vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/$rg/providers/Microsoft.Compute/virtualMachines/myVm02" +$listEntry = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentList]::new(); $listEntry.Id = $vmId +$request = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentInstallationRequest]::new() +$request.Action = 'Install' +$request.ManageAgentInstallationList = @($listEntry) +Invoke-AzDynatraceManageMonitorAgentInstallation -ResourceGroupName $rg -MonitorName $monitor -Request $request -PassThru +``` -Invoke-AzDynatraceManageMonitorAgentInstallation -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -JsonString $json -PassThru +Creates and submits a strongly-typed request object. + +### Example 4: Pipeline identity usage (monitor object) +```powershell +$monitorObj = Get-AzDynatraceMonitor -ResourceGroupName "myResourceGroup" -Name "myDynatraceMonitor" | Select-Object -First 1 +$vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm03" +$entry = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentList]::new(); $entry.Id = $vmId +$monitorObj | Invoke-AzDynatraceManageMonitorAgentInstallation -Action Install -ManageAgentInstallationList @($entry) -PassThru +``` + +Demonstrates identity parameter set by piping the monitor. + +### Example 5: JSON string input +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor"; $vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/$rg/providers/Microsoft.Compute/virtualMachines/myVm04" +$json = '{"action":"Install","manageAgentInstallationList":[{"id":"' + $vmId + '"}]}' +Invoke-AzDynatraceManageMonitorAgentInstallation -ResourceGroupName $rg -MonitorName $monitor -JsonString $json -PassThru +``` + +Passes the request as raw JSON. + +### Example 6: JSON file path input +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor"; $vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/$rg/providers/Microsoft.Compute/virtualMachines/myVm05" +$path = Join-Path $PWD 'agent-install.json' +@{ action = 'Install'; manageAgentInstallationList = @(@{ id = $vmId }) } | ConvertTo-Json -Depth 4 | Set-Content -Path $path -Encoding UTF8 +Invoke-AzDynatraceManageMonitorAgentInstallation -ResourceGroupName $rg -MonitorName $monitor -JsonFilePath $path -PassThru +``` + +Reads parameters from a JSON file. + +### Example 7: Uninstall using request object and identity pipeline +```powershell +$monitorObj = Get-AzDynatraceMonitor -ResourceGroupName "myResourceGroup" -Name "myDynatraceMonitor" | Select-Object -First 1 +$vmId = "/subscriptions/$(Get-AzContext).Subscription.Id/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm09" +$entry = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentList]::new(); $entry.Id = $vmId +$req = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.ManageAgentInstallationRequest]::new(); $req.Action = 'Uninstall'; $req.ManageAgentInstallationList = @($entry) +$monitorObj | Invoke-AzDynatraceManageMonitorAgentInstallation -Request $req -PassThru ``` -Provides the request payload as a JSON string to uninstall the Dynatrace agent from the target VM. Using -JsonString avoids manually constructing typed objects. +Combines identity pipeline with the -Request parameter set. ## PARAMETERS diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/New-AzDynatraceMonitoredSubscription.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/New-AzDynatraceMonitoredSubscription.md index 59d56a151c58..bcf8d00a4e4c 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/New-AzDynatraceMonitoredSubscription.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/New-AzDynatraceMonitoredSubscription.md @@ -38,35 +38,93 @@ Add the subscriptions that should be monitored by the Dynatrace monitor resource ## EXAMPLES -### Example 1: Add subscriptions to monitoring using an object list +### Example 1: Begin adding subscription monitoring (AddBegin) ```powershell -$subIds = @("11111111-1111-1111-1111-111111111111","22222222-2222-2222-2222-222222222222") -$list = @() -foreach ($id in $subIds) { - $entry = New-Object Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.MonitoredSubscription - $entry.SubscriptionId = $id - $list += $entry -} - -New-AzDynatraceMonitoredSubscription -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -MonitoredSubscriptionList $list -Operation "Add" +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$subscriptionId = (Get-AzContext).Subscription.Id + +# Initiate monitoring relationship (AddBegin) +$subs = @([Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.MonitoredSubscription]::new()) +$subs[0].Id = "/subscriptions/$subscriptionId" +New-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -MonitoredSubscriptionList $subs -Operation AddBegin ``` -Constructs an array of MonitoredSubscription objects and adds them to the Dynatrace monitor. Use -Operation "Add" to append monitoring entries. +Starts the monitored subscription onboarding workflow. +Some services require a follow-up AddComplete operation. -### Example 2: Add a subscription via JSON payload file +### Example 2: Complete add workflow (AddComplete) ```powershell -$json = @{ - monitoredSubscriptionList = @( - @{ subscriptionId = "33333333-3333-3333-3333-333333333333" } - ); - operation = "Add" -} | ConvertTo-Json -Depth 5 -$json | Out-File -FilePath .\addSubs.json -Encoding utf8 - -New-AzDynatraceMonitoredSubscription -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -JsonFilePath .\addSubs.json +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$subscriptionId = (Get-AzContext).Subscription.Id +$subs = @([Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.MonitoredSubscription]::new()) +$subs[0].Id = "/subscriptions/$subscriptionId" +New-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -MonitoredSubscriptionList $subs -Operation AddComplete ``` -Supplies the monitored subscription list and operation through a JSON file, useful for automation scenarios or larger batch updates. +Finalizes the monitoring relationship after an earlier AddBegin. + +### Example 3: Create via JSON string +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$subscriptionId = (Get-AzContext).Subscription.Id +$json = '{"monitoredSubscriptionList":[{"id":"/subscriptions/' + $subscriptionId + '"}],"operation":"AddBegin"}' +New-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -JsonString $json +``` + +Uses JSON payload rather than typed objects—helpful for automation or external template generation. + +### Example 4: Create via JSON file path +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$subscriptionId = (Get-AzContext).Subscription.Id +$path = Join-Path $PWD 'monitored-subscription.json' +@{ monitoredSubscriptionList = @(@{ id = "/subscriptions/$subscriptionId" }); operation = 'AddBegin' } | ConvertTo-Json -Depth 5 | Set-Content -Path $path -Encoding UTF8 +New-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -JsonFilePath $path +``` + +Reads creation parameters from a JSON file on disk. + +### Example 5: Pipeline identity usage with expanded parameters +```powershell +$monitorObj = Get-AzDynatraceMonitor -ResourceGroupName "myResourceGroup" -Name "myDynatraceMonitor" +$subscriptionId = (Get-AzContext).Subscription.Id +$subObj = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.MonitoredSubscription]::new(); $subObj.Id = "/subscriptions/$subscriptionId" +($monitorObj | New-AzDynatraceMonitoredSubscription -MonitoredSubscriptionList @($subObj) -Operation AddBegin) +``` + +Demonstrates identity parameter set by piping the monitor object. + +### Example 6: Dry run with -WhatIf +```powershell +$subscriptionId = (Get-AzContext).Subscription.Id +$subObj = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.MonitoredSubscription]::new(); $subObj.Id = "/subscriptions/$subscriptionId" +New-AzDynatraceMonitoredSubscription -ResourceGroupName "myResourceGroup" -MonitorName "myDynatraceMonitor" -MonitoredSubscriptionList @($subObj) -Operation AddBegin -WhatIf +``` + +Shows the operation details without persisting changes. + +### Example 7: JSON validation then completion +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor"; $sid = (Get-AzContext).Subscription.Id +$jsonBegin = '{"monitoredSubscriptionList":[{"id":"/subscriptions/' + $sid + '"}],"operation":"AddBegin"}' +New-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -JsonString $jsonBegin | Out-Null +$jsonComplete = '{"monitoredSubscriptionList":[{"id":"/subscriptions/' + $sid + '"}],"operation":"AddComplete"}' +New-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -JsonString $jsonComplete +``` + +Executes the two-step add workflow entirely via JSON payloads. + +### Example 8: Verify monitored subscription list +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor" +Get-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor | Select-Object -First 1 | Format-List Id,Name,Type +``` + +Retrieves and inspects monitored subscription after creation. ## PARAMETERS diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/README.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/README.md index 4e196b61d31e..fafc89f4b6d5 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/README.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/README.md @@ -1,5 +1,5 @@ # Docs -This directory contains the documentation of the cmdlets for the `Az.DynatraceObservability` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. +This directory contains the documentation of the cmdlets for the `Az.DynatraceObservability` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder. ## Info - Modifiable: no @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.DynatraceOb - Packaged: yes ## Details -The process of documentation generation loads `Az.DynatraceObservability` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.DynatraceObservability` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Remove-AzDynatraceMonitoredSubscription.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Remove-AzDynatraceMonitoredSubscription.md index 5abfa76c6b45..147bb944ad27 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Remove-AzDynatraceMonitoredSubscription.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Remove-AzDynatraceMonitoredSubscription.md @@ -30,21 +30,45 @@ Delete the subscriptions that are being monitored by the Dynatrace monitor resou ## EXAMPLES -### Example 1: Remove monitoring for a single subscription +### Example 1: Validate delete parameters (WhatIf) ```powershell -$subId = (Get-AzContext).Subscription.Id -Remove-AzDynatraceMonitoredSubscription -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -SubscriptionId $subId -PassThru +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +Remove-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -WhatIf ``` -Deletes the monitored subscription entry for the specified subscription. PassThru returns true when the deletion succeeds. +Performs a dry run; this matches the recorded validation step. -### Example 2: Run removal asynchronously as a background job +### Example 2: Delete monitored subscription (explicit parameters) ```powershell -$subId = "11111111-1111-1111-1111-111111111111" -Remove-AzDynatraceMonitoredSubscription -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -SubscriptionId $subId -AsJob +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +Remove-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -Confirm:$false ``` -Starts the removal operation as a PowerShell job allowing you to continue other tasks while the deletion completes. +Attempts deletion. +If the backend is fully provisioned, this should succeed; otherwise you may see `ResourceDeletionFailed`. + +### Example 3: Idempotent second delete +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +Remove-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -Confirm:$false -ErrorAction SilentlyContinue +``` + +Safe to run again; if already deleted, no change occurs. + +### Example 4: Handle transient backend errors +```powershell +$rg = "myResourceGroup"; $monitor = "myDynatraceMonitor" +try { + Remove-AzDynatraceMonitoredSubscription -ResourceGroupName $rg -MonitorName $monitor -Confirm:$false +} catch { + Write-Warning "Deletion failed: $($_.Exception.Message). Retry after confirming the monitored subscription was fully created." +} +``` + +Provides a pattern for handling intermittent service errors gracefully. ## PARAMETERS diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Update-AzDynatraceMonitorPlan.md b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Update-AzDynatraceMonitorPlan.md index d721e976138d..fecd909718d4 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Update-AzDynatraceMonitorPlan.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/docs/Update-AzDynatraceMonitorPlan.md @@ -59,29 +59,96 @@ Upgrades the billing Plan for Dynatrace monitor resource. ## EXAMPLES -### Example 1: Upgrade the plan using expanded parameters +### Example 1: Upgrade a monitor plan using expanded parameters ```powershell -Update-AzDynatraceMonitorPlan -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -PlanDataPlanDetail "enterprise-plan" -PlanDataUsageType "PAYG" -PlanDataBillingCycle "MONTHLY" -PlanDataEffectiveDate (Get-Date) -PassThru +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" + +# Move from trial/preview plan to committed monthly plan +$result = Update-AzDynatraceMonitorPlan -ResourceGroupName $rg -MonitorName $monitor ` + -PlanDataUsageType COMMITTED ` + -PlanDataBillingCycle "1-Month" ` + -PlanDataPlanDetail "dynatrace_azure_enterprise@TIDgmz7xq9ge3py" ` + -PlanDataEffectiveDate (Get-Date) -PassThru ``` -Upgrades the Dynatrace monitor to the specified plan (enterprise-plan) with PAYG usage type and a monthly billing cycle. PassThru returns true on success. +```output +True +``` + +Updates the monitor's billing plan directly by specifying each field. +Returns True on success. + +### Example 2: Use a request object (Upgrade parameter set) +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" + +# Construct upgrade request object +$req = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.UpgradePlanRequest]::new() +$req.PlanData = [Microsoft.Azure.PowerShell.Cmdlets.DynatraceObservability.Models.PlanData]::new() +$req.PlanData.UsageType = "COMMITTED" +$req.PlanData.BillingCycle = "1-Month" +$req.PlanData.PlanDetails = "dynatrace_azure_enterprise@TIDgmz7xq9ge3py" +$req.PlanData.EffectiveDate = Get-Date + +$ok = Update-AzDynatraceMonitorPlan -ResourceGroupName $rg -MonitorName $monitor -Request $req -PassThru +``` + +```output +True +``` + +Shows how to supply all plan data via the -Request object instead of individual parameters. + +### Example 3: Pipeline identity usage +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" + +Get-AzDynatraceMonitor -ResourceGroupName $rg -Name $monitor | \ + Update-AzDynatraceMonitorPlan -PlanDataUsageType COMMITTED -PlanDataBillingCycle "1-Month" -PlanDataPlanDetail "dynatrace_azure_enterprise@TIDgmz7xq9ge3py" -PassThru +``` -### Example 2: Upgrade the plan using a JSON file +Performs the upgrade by piping the monitor object (identity) and specifying expanded plan fields. + +### Example 4: JSON string input +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$json = '{"planData":{"usageType":"COMMITTED","billingCycle":"1-Month","planDetails":"dynatrace_azure_enterprise@TIDgmz7xq9ge3py","effectiveDate":"' + (Get-Date).ToString("o") + '"}}' +Update-AzDynatraceMonitorPlan -ResourceGroupName $rg -MonitorName $monitor -JsonString $json -PassThru +``` + +Passes plan properties as a JSON string. +Useful for scripting scenarios where you materialize JSON externally. + +### Example 5: JSON file path input +```powershell +$rg = "myResourceGroup" +$monitor = "myDynatraceMonitor" +$jsonPath = Join-Path $PWD 'upgrade-plan.json' +@{ planData = @{ usageType = 'COMMITTED'; billingCycle = '1-Month'; planDetails = 'dynatrace_azure_enterprise@TIDgmz7xq9ge3py'; effectiveDate = (Get-Date) } } | ConvertTo-Json -Depth 5 | Set-Content -Path $jsonPath -Encoding UTF8 +Update-AzDynatraceMonitorPlan -ResourceGroupName $rg -MonitorName $monitor -JsonFilePath $jsonPath -PassThru +``` + +Reads the plan update payload from a JSON file on disk. + +### Example 6: Dry run with -WhatIf ```powershell -$json = @{ - planData = @{ - planDetail = "premium-plan"; - usageType = "COMMITTED"; - billingCycle = "MONTHLY"; - effectiveDate = (Get-Date).ToString("o") - } -} | ConvertTo-Json -Depth 5 -$json | Out-File -FilePath .\upgradePlan.json -Encoding utf8 +Update-AzDynatraceMonitorPlan -ResourceGroupName "myResourceGroup" -MonitorName "myDynatraceMonitor" -PlanDataUsageType COMMITTED -PlanDataBillingCycle "1-Month" -PlanDataPlanDetail "dynatrace_azure_enterprise@TIDgmz7xq9ge3py" -WhatIf +``` + +Shows what would change without performing the actual update. -Update-AzDynatraceMonitorPlan -MonitorName "myDynatraceMonitor" -ResourceGroupName "myResourceGroup" -JsonFilePath .\upgradePlan.json -PassThru +### Example 7: Verify plan after update +```powershell +Update-AzDynatraceMonitorPlan -ResourceGroupName $rg -MonitorName $monitor -PlanDataUsageType COMMITTED -PlanDataBillingCycle "1-Month" -PlanDataPlanDetail "dynatrace_azure_enterprise@TIDgmz7xq9ge3py" -PassThru | Out-Null +$updated = Get-AzDynatraceMonitor -ResourceGroupName $rg -Name $monitor +$updated.planData | Format-List UsageType,BillingCycle,PlanDetails,EffectiveDate ``` -Provides the upgrade request body via JSON, useful for automation or storing predefined plan configurations. +Retrieves the monitor to validate the new plan details after a successful upgrade. ## PARAMETERS diff --git a/src/DynatraceObservability/DynatraceObservability.Autorest/resources/README.md b/src/DynatraceObservability/DynatraceObservability.Autorest/resources/README.md deleted file mode 100644 index 736492341e3d..000000000000 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/resources/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/src/DynatraceObservability/DynatraceObservability.Autorest/test/README.md b/src/DynatraceObservability/DynatraceObservability.Autorest/test/README.md index 1969200c6a09..7c752b4c8c43 100644 --- a/src/DynatraceObservability/DynatraceObservability.Autorest/test/README.md +++ b/src/DynatraceObservability/DynatraceObservability.Autorest/test/README.md @@ -1,5 +1,5 @@ # Test -This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. ## Info - Modifiable: yes diff --git a/src/DynatraceObservability/DynatraceObservability/AutorestUpgradeLog.md b/src/DynatraceObservability/DynatraceObservability/AutorestUpgradeLog.md new file mode 100644 index 000000000000..590002b8e77b --- /dev/null +++ b/src/DynatraceObservability/DynatraceObservability/AutorestUpgradeLog.md @@ -0,0 +1,2 @@ +## Autorest upgrade log +* Autorest version: 4.0.752 - 26-01-11 diff --git a/src/EdgeAction/EdgeAction.Autorest/Properties/AssemblyInfo.cs b/src/EdgeAction/EdgeAction.Autorest/Properties/AssemblyInfo.cs index 9132b8b08f39..150a4afb49b5 100644 --- a/src/EdgeAction/EdgeAction.Autorest/Properties/AssemblyInfo.cs +++ b/src/EdgeAction/EdgeAction.Autorest/Properties/AssemblyInfo.cs @@ -20,13 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - EdgeAction")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] -[assembly: System.CLSCompliantAttribute(false)] - - - - - - +[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Add-AzEdgeActionAttachment.md b/src/EdgeAction/EdgeAction.Autorest/docs/Add-AzEdgeActionAttachment.md index 96d3cc62da9e..e275e6883a75 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Add-AzEdgeActionAttachment.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Add-AzEdgeActionAttachment.md @@ -62,14 +62,14 @@ A long-running resource action. Add-AzEdgeActionAttachment -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -AttachedResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myAfdProfile/rulesets/myRuleSet/rules/myRule" ``` -This command attaches an Azure Front Door rule to the specified edge action, enabling the edge action to process requests for that rule. +Attaches an Azure Front Door rule to the specified edge action, enabling the edge action to process requests for that rule. ### Example 2: Attach an AFD rule using pipeline input ```powershell Get-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" | Add-AzEdgeActionAttachment -AttachedResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myAfdProfile/rulesets/myRuleSet/rules/myRule" ``` -This command retrieves an edge action and pipes it to attach an AFD rule. +Retrieves an edge action and pipes it to attach an AFD rule. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Az.EdgeAction.md b/src/EdgeAction/EdgeAction.Autorest/docs/Az.EdgeAction.md index 35f45ff787e8..8dbe1074d49a 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Az.EdgeAction.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Az.EdgeAction.md @@ -1,6 +1,6 @@ --- Module Name: Az.EdgeAction -Module Guid: 9684b1ec-34c5-477b-9878-aa83099528e2 +Module Guid: 6dbb9854-3fdb-4703-866f-ec4eb291d337 Download Help Link: https://learn.microsoft.com/powershell/module/az.edgeaction Help Version: 1.0.0.0 Locale: en-US diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Get-AzEdgeActionExecutionFilter.md b/src/EdgeAction/EdgeAction.Autorest/docs/Get-AzEdgeActionExecutionFilter.md index 9835135c9f3a..1ba6b8eb347a 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Get-AzEdgeActionExecutionFilter.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Get-AzEdgeActionExecutionFilter.md @@ -43,17 +43,30 @@ Get a EdgeActionExecutionFilter ### Example 1: List all execution filters for an edge action ```powershell -Get-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" +Get-AzEdgeActionExecutionFilter -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" ``` -This command lists all execution filters associated with the specified edge action. +```output +Name Location ProvisioningState +---- -------- ----------------- +filter1 global Succeeded +filter2 global Succeeded +``` + +Lists all execution filters configured for the specified edge action. -### Example 2: Get a specific execution filter by name +### Example 2: Get a specific execution filter ```powershell -Get-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "myFilter" +Get-AzEdgeActionExecutionFilter -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Name "filter1" +``` + +```output +Name Location ProvisioningState +---- -------- ----------------- +filter1 global Succeeded ``` -This command retrieves a specific execution filter by name from the specified edge action. +Gets details of the specified execution filter. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/New-AzEdgeActionExecutionFilter.md b/src/EdgeAction/EdgeAction.Autorest/docs/New-AzEdgeActionExecutionFilter.md index d243d7845936..aeed887745f5 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/New-AzEdgeActionExecutionFilter.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/New-AzEdgeActionExecutionFilter.md @@ -54,19 +54,18 @@ Create a EdgeActionExecutionFilter ## EXAMPLES -### Example 1: Create an execution filter with header-based routing +### Example 1: Create an execution filter for an edge action ```powershell -New-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "myFilter" -Location "eastus" -ExecutionFilterIdentifierHeaderName "X-Custom-Header" -ExecutionFilterIdentifierHeaderValue "production" +New-AzEdgeActionExecutionFilter -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Name "myFilter" -Location "global" -Order 1 ``` -This command creates a new execution filter with custom header-based routing for the specified edge action. - -### Example 2: Create an execution filter targeting a specific version -```powershell -New-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "v2Filter" -Location "eastus" -VersionId "v2" -Tag @{Environment="staging"} +```output +Name Location ProvisioningState Order +---- -------- ----------------- ----- +myFilter global Succeeded 1 ``` -This command creates an execution filter that routes traffic to a specific edge action version with tags. +Creates a new execution filter that controls when the edge action is executed. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeAction.md b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeAction.md index 7184bd74f967..9a07a67df884 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeAction.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeAction.md @@ -29,19 +29,12 @@ Delete a EdgeAction ## EXAMPLES -### Example 1: Remove an edge action by name +### Example 1: Delete an edge action ```powershell -Remove-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" +Remove-AzEdgeAction -ResourceGroupName "myResourceGroup" -Name "myEdgeAction" ``` -This command removes the specified edge action from the resource group. - -### Example 2: Remove an edge action using pipeline input -```powershell -Get-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" | Remove-AzEdgeAction -``` - -This command retrieves an edge action and pipes it to remove the resource. +Deletes the specified edge action and all its associated versions and filters. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionAttachment.md b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionAttachment.md index be581aa3408d..bfee2a00936c 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionAttachment.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionAttachment.md @@ -62,14 +62,14 @@ A long-running resource action. Remove-AzEdgeActionAttachment -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -AttachedResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myAfdProfile/rulesets/myRuleSet/rules/myRule" ``` -This command removes the specified AFD rule attachment from the edge action. +Removes the specified AFD rule attachment from the edge action. ### Example 2: Remove an attachment using pipeline input ```powershell Get-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" | Remove-AzEdgeActionAttachment -AttachedResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Cdn/profiles/myAfdProfile/rulesets/myRuleSet/rules/myRule" ``` -This command retrieves an edge action and pipes it to remove the specified AFD rule attachment. +Retrieves an edge action and pipes it to remove the specified AFD rule attachment. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionExecutionFilter.md b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionExecutionFilter.md index ee65fd7cdcec..a1fd90ee9cb7 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionExecutionFilter.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionExecutionFilter.md @@ -36,19 +36,12 @@ Delete a EdgeActionExecutionFilter ## EXAMPLES -### Example 1: Remove an execution filter by name +### Example 1: Delete an execution filter ```powershell -Remove-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "myFilter" +Remove-AzEdgeActionExecutionFilter -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Name "myFilter" ``` -This command removes the specified execution filter from the edge action. - -### Example 2: Remove an execution filter using pipeline input -```powershell -Get-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "myFilter" | Remove-AzEdgeActionExecutionFilter -``` - -This command retrieves an execution filter and pipes it to remove the resource. +Deletes the specified execution filter from the edge action. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionVersion.md b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionVersion.md index 504f852ed900..397e942de030 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionVersion.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Remove-AzEdgeActionVersion.md @@ -36,19 +36,12 @@ Delete a EdgeActionVersion ## EXAMPLES -### Example 1: Remove an edge action version by name +### Example 1: Delete an edge action version ```powershell -Remove-AzEdgeActionVersion -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -Version "v1" +Remove-AzEdgeActionVersion -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Version "v1" ``` -This command removes the specified version from the edge action. - -### Example 2: Remove an edge action version using pipeline input -```powershell -Get-AzEdgeActionVersion -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -Version "v1" | Remove-AzEdgeActionVersion -``` - -This command retrieves an edge action version and pipes it to remove the resource. +Deletes the specified version from the edge action. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Switch-AzEdgeActionVersionDefault.md b/src/EdgeAction/EdgeAction.Autorest/docs/Switch-AzEdgeActionVersionDefault.md index d82c9a0098ad..2d5129280f2e 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Switch-AzEdgeActionVersionDefault.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Switch-AzEdgeActionVersionDefault.md @@ -38,17 +38,17 @@ A long-running resource action. ### Example 1: Switch the default version of an edge action ```powershell -Switch-AzEdgeActionVersionDefault -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -Version "v2" +Switch-AzEdgeActionVersionDefault -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Version "v2" ``` -This command switches the default version of the edge action to the specified version. - -### Example 2: Switch default version using pipeline input -```powershell -Get-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" | Switch-AzEdgeActionVersionDefault -Version "v2" +```output +Name Location ProvisioningState +---- -------- ----------------- +v2 global Succeeded ``` -This command retrieves an edge action and pipes it to switch the default version. +Switches the default version of the edge action to v2. +All traffic will now be routed to this version. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeAction.md b/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeAction.md index 6f18d8cc2fa3..c2c2da661149 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeAction.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeAction.md @@ -43,19 +43,18 @@ Update a EdgeAction ## EXAMPLES -### Example 1: Update edge action tags +### Example 1: Update an edge action with tags ```powershell -Update-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" -Tag @{Environment="production"; Team="platform"} +Update-AzEdgeAction -ResourceGroupName "myResourceGroup" -Name "myEdgeAction" -Tag @{ Environment = "Production"; Team = "Platform" } ``` -This command updates the tags on the specified edge action. - -### Example 2: Update edge action SKU -```powershell -Update-AzEdgeAction -Name "myEdgeAction" -ResourceGroupName "myResourceGroup" -SkuName "Standard" -SkuTier "Standard" +```output +Name Location ProvisioningState SkuName SkuTier +---- -------- ----------------- ------- ------- +myEdgeAction global Succeeded Standard Standard ``` -This command updates the SKU configuration of the specified edge action. +Updates the specified edge action with the provided tags. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionExecutionFilter.md b/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionExecutionFilter.md index 2cc244d2cc16..9ad523421f3d 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionExecutionFilter.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionExecutionFilter.md @@ -57,19 +57,18 @@ Update a EdgeActionExecutionFilter ## EXAMPLES -### Example 1: Update execution filter tags +### Example 1: Update an execution filter with tags ```powershell -Update-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "myFilter" -Tag @{Environment="staging"} +Update-AzEdgeActionExecutionFilter -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Name "myFilter" -Tag @{ Environment = "Production" } ``` -This command updates the tags on the specified execution filter. - -### Example 2: Update execution filter using pipeline input -```powershell -Get-AzEdgeActionExecutionFilter -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -ExecutionFilter "myFilter" | Update-AzEdgeActionExecutionFilter -Tag @{Environment="production"} +```output +Name Location ProvisioningState +---- -------- ----------------- +myFilter global Succeeded ``` -This command retrieves an execution filter and pipes it to update the tags. +Updates the specified execution filter with the provided tags. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionVersion.md b/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionVersion.md index aaace1763238..5e5cd6302d5f 100644 --- a/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionVersion.md +++ b/src/EdgeAction/EdgeAction.Autorest/docs/Update-AzEdgeActionVersion.md @@ -57,19 +57,18 @@ Update a EdgeActionVersion ## EXAMPLES -### Example 1: Update edge action version tags +### Example 1: Update an edge action version with tags ```powershell -Update-AzEdgeActionVersion -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -Version "v1" -Tag @{Environment="staging"} +Update-AzEdgeActionVersion -ResourceGroupName "myResourceGroup" -EdgeActionName "myEdgeAction" -Version "v1" -Tag @{ Environment = "Production"; Team = "Platform" } ``` -This command updates the tags on the specified edge action version. - -### Example 2: Update edge action version using pipeline input -```powershell -Get-AzEdgeActionVersion -EdgeActionName "myEdgeAction" -ResourceGroupName "myResourceGroup" -Version "v1" | Update-AzEdgeActionVersion -Tag @{Environment="production"} +```output +Name Location ProvisioningState +---- -------- ----------------- +v1 global Succeeded ``` -This command retrieves an edge action version and pipes it to update the tags. +Updates the specified edge action version with the provided tags. ## PARAMETERS diff --git a/src/EdgeAction/EdgeAction.Autorest/resources/README.md b/src/EdgeAction/EdgeAction.Autorest/resources/README.md deleted file mode 100644 index 937f07f8fec2..000000000000 --- a/src/EdgeAction/EdgeAction.Autorest/resources/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/src/EdgeAction/EdgeAction/AutorestUpgradeLog.md b/src/EdgeAction/EdgeAction/AutorestUpgradeLog.md new file mode 100644 index 000000000000..590002b8e77b --- /dev/null +++ b/src/EdgeAction/EdgeAction/AutorestUpgradeLog.md @@ -0,0 +1,2 @@ +## Autorest upgrade log +* Autorest version: 4.0.752 - 26-01-11 diff --git a/src/Monitor/ActionGroup.Autorest/Properties/AssemblyInfo.cs b/src/Monitor/ActionGroup.Autorest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..da77c0575271 --- /dev/null +++ b/src/Monitor/ActionGroup.Autorest/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +// 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. + +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[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 - ActionGroup")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupArmRoleReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupArmRoleReceiverObject.ps1 index 14163bfc166f..fad7e8effcd4 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupArmRoleReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupArmRoleReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ArmRoleReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongrouparmrolereceiverobject #> function New-AzActionGroupArmRoleReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ArmRoleReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAutomationRunbookReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAutomationRunbookReceiverObject.ps1 index 36efb28bbe6c..291124a8a8b5 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAutomationRunbookReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAutomationRunbookReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.AutomationRunbookR https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupautomationrunbookreceiverobject #> function New-AzActionGroupAutomationRunbookReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.AutomationRunbookReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureAppPushReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureAppPushReceiverObject.ps1 index 4003e307eb6d..a2057380cac1 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureAppPushReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureAppPushReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.AzureAppPushReceiv https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupazureapppushreceiverobject #> function New-AzActionGroupAzureAppPushReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.AzureAppPushReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureFunctionReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureFunctionReceiverObject.ps1 index 508c3ec81487..5bfc905c5396 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureFunctionReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupAzureFunctionReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.AzureFunctionRecei https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupazurefunctionreceiverobject #> function New-AzActionGroupAzureFunctionReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.AzureFunctionReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEmailReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEmailReceiverObject.ps1 index afec5d5444d3..f820c1bc436f 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEmailReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEmailReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.EmailReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupemailreceiverobject #> function New-AzActionGroupEmailReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.EmailReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEventHubReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEventHubReceiverObject.ps1 index 1218b4750d25..daa13eccba4a 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEventHubReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupEventHubReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.EventHubReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupeventhubreceiverobject #> function New-AzActionGroupEventHubReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.EventHubReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupItsmReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupItsmReceiverObject.ps1 index d32cda17ce9d..bf4ef1ae2744 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupItsmReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupItsmReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ItsmReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupitsmreceiverobject #> function New-AzActionGroupItsmReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.ItsmReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupLogicAppReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupLogicAppReceiverObject.ps1 index 98899e294598..7e15d93e9bad 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupLogicAppReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupLogicAppReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.LogicAppReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongrouplogicappreceiverobject #> function New-AzActionGroupLogicAppReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.LogicAppReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupSmsReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupSmsReceiverObject.ps1 index a9096cc6c792..127855806432 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupSmsReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupSmsReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.SmsReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupsmsreceiverobject #> function New-AzActionGroupSmsReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.SmsReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupVoiceReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupVoiceReceiverObject.ps1 index 1e49eae64e26..a3a487e57218 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupVoiceReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupVoiceReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.VoiceReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupvoicereceiverobject #> function New-AzActionGroupVoiceReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.VoiceReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupWebhookReceiverObject.ps1 b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupWebhookReceiverObject.ps1 index bf39f214217c..211047336ada 100644 --- a/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupWebhookReceiverObject.ps1 +++ b/src/Monitor/ActionGroup.Autorest/custom/autogen-model-cmdlets/New-AzActionGroupWebhookReceiverObject.ps1 @@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.WebhookReceiver https://learn.microsoft.com/powershell/module/Az.Monitor/new-azactiongroupwebhookreceiverobject #> function New-AzActionGroupWebhookReceiverObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.ModelCmdletAttribute()] [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Models.WebhookReceiver')] [CmdletBinding(PositionalBinding=$false)] Param( diff --git a/src/Monitor/ActionGroup.Autorest/docs/Az.ActionGroup.md b/src/Monitor/ActionGroup.Autorest/docs/Az.ActionGroup.md index 05779aeced30..a7672378b05e 100644 --- a/src/Monitor/ActionGroup.Autorest/docs/Az.ActionGroup.md +++ b/src/Monitor/ActionGroup.Autorest/docs/Az.ActionGroup.md @@ -1,6 +1,6 @@ --- Module Name: Az.ActionGroup -Module Guid: c9f47937-c60a-4575-b669-442455ef6728 +Module Guid: b7ca2be8-de7c-4879-b561-cd5e39c3d771 Download Help Link: https://learn.microsoft.com/powershell/module/az.actiongroup Help Version: 1.0.0.0 Locale: en-US @@ -20,7 +20,7 @@ This operation is only supported for Email or SMS receivers. Get an action group. ### [New-AzActionGroup](New-AzActionGroup.md) -create a new action group or create an existing one. +Create a new action group or create an existing one. ### [New-AzActionGroupArmRoleReceiverObject](New-AzActionGroupArmRoleReceiverObject.md) Create an in-memory object for ArmRoleReceiver. @@ -62,5 +62,5 @@ Delete an action group. Send test notifications to a set of provided receivers ### [Update-AzActionGroup](Update-AzActionGroup.md) -update a new action group or update an existing one. +Update a new action group or update an existing one. diff --git a/src/Monitor/ActionGroup.Autorest/docs/New-AzActionGroup.md b/src/Monitor/ActionGroup.Autorest/docs/New-AzActionGroup.md index 9851b7e778e2..e2ff2891aad7 100644 --- a/src/Monitor/ActionGroup.Autorest/docs/New-AzActionGroup.md +++ b/src/Monitor/ActionGroup.Autorest/docs/New-AzActionGroup.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-AzActionGroup ## SYNOPSIS -create a new action group or create an existing one. +Create a new action group or create an existing one. ## SYNTAX @@ -49,7 +49,7 @@ New-AzActionGroup -Name -ResourceGroupName -JsonString [-ArmRoleReceiver +function New-AzAutoscaleNotificationObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(HelpMessage="the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored.")] + [string[]] + $EmailCustomEmail, + [Parameter(HelpMessage="a value indicating whether to send email to subscription administrator.")] + [bool] + $EmailSendToSubscriptionAdministrator, + [Parameter(HelpMessage="a value indicating whether to send email to subscription co-administrators.")] + [bool] + $EmailSendToSubscriptionCoAdministrator, + [Parameter(HelpMessage="the collection of webhook notifications.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification[]] + $Webhook + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification]::New() + + if ($PSBoundParameters.ContainsKey('EmailCustomEmail')) { + $Object.EmailCustomEmail = $EmailCustomEmail + } + if ($PSBoundParameters.ContainsKey('EmailSendToSubscriptionAdministrator')) { + $Object.EmailSendToSubscriptionAdministrator = $EmailSendToSubscriptionAdministrator + } + if ($PSBoundParameters.ContainsKey('EmailSendToSubscriptionCoAdministrator')) { + $Object.EmailSendToSubscriptionCoAdministrator = $EmailSendToSubscriptionCoAdministrator + } + if ($PSBoundParameters.ContainsKey('Webhook')) { + $Object.Webhook = $Webhook + } + return $Object + } +} diff --git a/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleProfileObject.ps1 b/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleProfileObject.ps1 new file mode 100644 index 000000000000..2afbe6b29447 --- /dev/null +++ b/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleProfileObject.ps1 @@ -0,0 +1,120 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for AutoscaleProfile. +.Description +Create an in-memory object for AutoscaleProfile. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile +.Link +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscaleprofileobject +#> +function New-AzAutoscaleProfileObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(Mandatory, HelpMessage="the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default.")] + [string] + $CapacityDefault, + [Parameter(Mandatory, HelpMessage="the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription.")] + [string] + $CapacityMaximum, + [Parameter(Mandatory, HelpMessage="the minimum number of instances for the resource.")] + [string] + $CapacityMinimum, + [Parameter(HelpMessage="the end time for the profile in ISO 8601 format.")] + [System.DateTime] + $FixedDateEnd, + [Parameter(HelpMessage="the start time for the profile in ISO 8601 format.")] + [System.DateTime] + $FixedDateStart, + [Parameter(HelpMessage="the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time.")] + [string] + $FixedDateTimeZone, + [Parameter(Mandatory, HelpMessage="the name of the profile.")] + [string] + $Name, + [Parameter(HelpMessage="the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")] + [string] + $RecurrenceFrequency, + [Parameter(Mandatory, HelpMessage="the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule[]] + $Rule, + [Parameter(HelpMessage="the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.")] + [string[]] + $ScheduleDay, + [Parameter(HelpMessage="A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported).")] + [int[]] + $ScheduleHour, + [Parameter(HelpMessage="A collection of minutes at which the profile takes effect at.")] + [int[]] + $ScheduleMinute, + [Parameter(HelpMessage="the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time.")] + [string] + $ScheduleTimeZone + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile]::New() + + if ($PSBoundParameters.ContainsKey('CapacityDefault')) { + $Object.CapacityDefault = $CapacityDefault + } + if ($PSBoundParameters.ContainsKey('CapacityMaximum')) { + $Object.CapacityMaximum = $CapacityMaximum + } + if ($PSBoundParameters.ContainsKey('CapacityMinimum')) { + $Object.CapacityMinimum = $CapacityMinimum + } + if ($PSBoundParameters.ContainsKey('FixedDateEnd')) { + $Object.FixedDateEnd = $FixedDateEnd + } + if ($PSBoundParameters.ContainsKey('FixedDateStart')) { + $Object.FixedDateStart = $FixedDateStart + } + if ($PSBoundParameters.ContainsKey('FixedDateTimeZone')) { + $Object.FixedDateTimeZone = $FixedDateTimeZone + } + if ($PSBoundParameters.ContainsKey('Name')) { + $Object.Name = $Name + } + if ($PSBoundParameters.ContainsKey('RecurrenceFrequency')) { + $Object.RecurrenceFrequency = $RecurrenceFrequency + } + if ($PSBoundParameters.ContainsKey('Rule')) { + $Object.Rule = $Rule + } + if ($PSBoundParameters.ContainsKey('ScheduleDay')) { + $Object.ScheduleDay = $ScheduleDay + } + if ($PSBoundParameters.ContainsKey('ScheduleHour')) { + $Object.ScheduleHour = $ScheduleHour + } + if ($PSBoundParameters.ContainsKey('ScheduleMinute')) { + $Object.ScheduleMinute = $ScheduleMinute + } + if ($PSBoundParameters.ContainsKey('ScheduleTimeZone')) { + $Object.ScheduleTimeZone = $ScheduleTimeZone + } + return $Object + } +} diff --git a/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 b/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 new file mode 100644 index 000000000000..3128254b2b5a --- /dev/null +++ b/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleScaleRuleMetricDimensionObject.ps1 @@ -0,0 +1,60 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ScaleRuleMetricDimension. +.Description +Create an in-memory object for ScaleRuleMetricDimension. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension +.Link +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescalerulemetricdimensionobject +#> +function New-AzAutoscaleScaleRuleMetricDimensionObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(Mandatory, HelpMessage="Name of the dimension.")] + [string] + $DimensionName, + [Parameter(Mandatory, HelpMessage="the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals")] + [string] + $Operator, + [Parameter(Mandatory, HelpMessage="list of dimension values. For example: [`"App1`",`"App2`"].")] + [string[]] + $Value + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension]::New() + + if ($PSBoundParameters.ContainsKey('DimensionName')) { + $Object.DimensionName = $DimensionName + } + if ($PSBoundParameters.ContainsKey('Operator')) { + $Object.Operator = $Operator + } + if ($PSBoundParameters.ContainsKey('Value')) { + $Object.Value = $Value + } + return $Object + } +} diff --git a/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleScaleRuleObject.ps1 b/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleScaleRuleObject.ps1 new file mode 100644 index 000000000000..d45622c84f12 --- /dev/null +++ b/src/Monitor/Autoscale.Autorest/custom/autogen-model-cmdlets/New-AzAutoscaleScaleRuleObject.ps1 @@ -0,0 +1,142 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ScaleRule. +.Description +Create an in-memory object for ScaleRule. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule +.Link +https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescaleruleobject +#> +function New-AzAutoscaleScaleRuleObject { + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(HelpMessage="List of dimension conditions. For example: [{`"DimensionName`":`"AppName`",`"Operator`":`"Equals`",`"Values`":[`"App1`"]},{`"DimensionName`":`"Deployment`",`"Operator`":`"Equals`",`"Values`":[`"default`"]}].")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension[]] + $MetricTriggerDimension, + [Parameter(HelpMessage="a value indicating whether metric should divide per instance.")] + [bool] + $MetricTriggerDividePerInstance, + [Parameter(Mandatory, HelpMessage="the name of the metric that defines what the rule monitors.")] + [string] + $MetricTriggerMetricName, + [Parameter(HelpMessage="the namespace of the metric that defines what the rule monitors.")] + [string] + $MetricTriggerMetricNamespace, + [Parameter(HelpMessage="the location of the resource the rule monitors.")] + [string] + $MetricTriggerMetricResourceLocation, + [Parameter(Mandatory, HelpMessage="the resource identifier of the resource the rule monitors.")] + [string] + $MetricTriggerMetricResourceUri, + [Parameter(Mandatory, HelpMessage="the operator that is used to compare the metric data and the threshold.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")] + [string] + $MetricTriggerOperator, + [Parameter(Mandatory, HelpMessage="the metric statistic type. How the metrics from multiple instances are combined.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")] + [string] + $MetricTriggerStatistic, + [Parameter(Mandatory, HelpMessage="the threshold of the metric that triggers the scale action.")] + [double] + $MetricTriggerThreshold, + [Parameter(Mandatory, HelpMessage="time aggregation type. How the data that is collected should be combined over time. The default value is Average.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")] + [string] + $MetricTriggerTimeAggregation, + [Parameter(Mandatory, HelpMessage="the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.")] + [System.TimeSpan] + $MetricTriggerTimeGrain, + [Parameter(Mandatory, HelpMessage="the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.")] + [System.TimeSpan] + $MetricTriggerTimeWindow, + [Parameter(Mandatory, HelpMessage="the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format.")] + [System.TimeSpan] + $ScaleActionCooldown, + [Parameter(Mandatory, HelpMessage="the scale direction. Whether the scaling action increases or decreases the number of instances.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")] + [string] + $ScaleActionDirection, + [Parameter(Mandatory, HelpMessage="the type of action that should occur when the scale rule fires.")] + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")] + [string] + $ScaleActionType, + [Parameter(HelpMessage="the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.")] + [string] + $ScaleActionValue + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule]::New() + + if ($PSBoundParameters.ContainsKey('MetricTriggerDimension')) { + $Object.MetricTriggerDimension = $MetricTriggerDimension + } + if ($PSBoundParameters.ContainsKey('MetricTriggerDividePerInstance')) { + $Object.MetricTriggerDividePerInstance = $MetricTriggerDividePerInstance + } + if ($PSBoundParameters.ContainsKey('MetricTriggerMetricName')) { + $Object.MetricTriggerMetricName = $MetricTriggerMetricName + } + if ($PSBoundParameters.ContainsKey('MetricTriggerMetricNamespace')) { + $Object.MetricTriggerMetricNamespace = $MetricTriggerMetricNamespace + } + if ($PSBoundParameters.ContainsKey('MetricTriggerMetricResourceLocation')) { + $Object.MetricTriggerMetricResourceLocation = $MetricTriggerMetricResourceLocation + } + if ($PSBoundParameters.ContainsKey('MetricTriggerMetricResourceUri')) { + $Object.MetricTriggerMetricResourceUri = $MetricTriggerMetricResourceUri + } + if ($PSBoundParameters.ContainsKey('MetricTriggerOperator')) { + $Object.MetricTriggerOperator = $MetricTriggerOperator + } + if ($PSBoundParameters.ContainsKey('MetricTriggerStatistic')) { + $Object.MetricTriggerStatistic = $MetricTriggerStatistic + } + if ($PSBoundParameters.ContainsKey('MetricTriggerThreshold')) { + $Object.MetricTriggerThreshold = $MetricTriggerThreshold + } + if ($PSBoundParameters.ContainsKey('MetricTriggerTimeAggregation')) { + $Object.MetricTriggerTimeAggregation = $MetricTriggerTimeAggregation + } + if ($PSBoundParameters.ContainsKey('MetricTriggerTimeGrain')) { + $Object.MetricTriggerTimeGrain = $MetricTriggerTimeGrain + } + if ($PSBoundParameters.ContainsKey('MetricTriggerTimeWindow')) { + $Object.MetricTriggerTimeWindow = $MetricTriggerTimeWindow + } + if ($PSBoundParameters.ContainsKey('ScaleActionCooldown')) { + $Object.ScaleActionCooldown = $ScaleActionCooldown + } + if ($PSBoundParameters.ContainsKey('ScaleActionDirection')) { + $Object.ScaleActionDirection = $ScaleActionDirection + } + if ($PSBoundParameters.ContainsKey('ScaleActionType')) { + $Object.ScaleActionType = $ScaleActionType + } + if ($PSBoundParameters.ContainsKey('ScaleActionValue')) { + $Object.ScaleActionValue = $ScaleActionValue + } + return $Object + } +} diff --git a/src/Monitor/Autoscale.Autorest/docs/Az.Autoscale.md b/src/Monitor/Autoscale.Autorest/docs/Az.Autoscale.md index fa16340ec305..b272b6b25a5b 100644 --- a/src/Monitor/Autoscale.Autorest/docs/Az.Autoscale.md +++ b/src/Monitor/Autoscale.Autorest/docs/Az.Autoscale.md @@ -1,6 +1,6 @@ --- Module Name: Az.Autoscale -Module Guid: a9b125f5-74a5-4fd4-a060-a0fdb28485e1 +Module Guid: 6e47eac8-182f-4b16-b603-68c90f93ace1 Download Help Link: https://learn.microsoft.com/powershell/module/az.autoscale Help Version: 1.0.0.0 Locale: en-US diff --git a/src/Monitor/Autoscale.Autorest/resources/README.md b/src/Monitor/Autoscale.Autorest/resources/README.md deleted file mode 100644 index 937f07f8fec2..000000000000 --- a/src/Monitor/Autoscale.Autorest/resources/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/src/Monitor/DataCollectionRule.Autorest/Properties/AssemblyInfo.cs b/src/Monitor/DataCollectionRule.Autorest/Properties/AssemblyInfo.cs index 8eb44c9080d6..15a72a4cd2c3 100644 --- a/src/Monitor/DataCollectionRule.Autorest/Properties/AssemblyInfo.cs +++ b/src/Monitor/DataCollectionRule.Autorest/Properties/AssemblyInfo.cs @@ -20,10 +20,7 @@ [assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] [assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] [assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataCollectionRule")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("6.0.2")] -[assembly: System.Reflection.AssemblyVersionAttribute("6.0.2")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] -[assembly: System.CLSCompliantAttribute(false)] - - - +[assembly: System.CLSCompliantAttribute(false)] \ No newline at end of file diff --git a/src/Monitor/DataCollectionRule.Autorest/docs/Az.DataCollectionRule.md b/src/Monitor/DataCollectionRule.Autorest/docs/Az.DataCollectionRule.md index 7cbd7ffeed61..6afedac17c54 100644 --- a/src/Monitor/DataCollectionRule.Autorest/docs/Az.DataCollectionRule.md +++ b/src/Monitor/DataCollectionRule.Autorest/docs/Az.DataCollectionRule.md @@ -1,6 +1,6 @@ --- Module Name: Az.DataCollectionRule -Module Guid: cdb86053-4116-4141-b74b-b90f88b83813 +Module Guid: e9b0129c-54c9-49a9-a29d-4f8a552f0336 Download Help Link: https://learn.microsoft.com/powershell/module/az.datacollectionrule Help Version: 1.0.0.0 Locale: en-US @@ -21,13 +21,13 @@ Returns the specified data collection rule. Returns the specified association. ### [New-AzDataCollectionEndpoint](New-AzDataCollectionEndpoint.md) -create a data collection endpoint. +Create a data collection endpoint. ### [New-AzDataCollectionRule](New-AzDataCollectionRule.md) -create a data collection rule. +Create a data collection rule. ### [New-AzDataCollectionRuleAssociation](New-AzDataCollectionRuleAssociation.md) -create an association. +Create an association. ### [New-AzDataFlowObject](New-AzDataFlowObject.md) Create an in-memory object for DataFlow. @@ -87,11 +87,11 @@ Deletes a data collection rule. Deletes an association. ### [Update-AzDataCollectionEndpoint](Update-AzDataCollectionEndpoint.md) -update a data collection endpoint. +Update a data collection endpoint. ### [Update-AzDataCollectionRule](Update-AzDataCollectionRule.md) Update a data collection rule. ### [Update-AzDataCollectionRuleAssociation](Update-AzDataCollectionRuleAssociation.md) -update an association. +Update an association. diff --git a/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionEndpoint.md b/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionEndpoint.md index 59b0baf65648..aa0c8d57f01f 100644 --- a/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionEndpoint.md +++ b/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionEndpoint.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-AzDataCollectionEndpoint ## SYNOPSIS -create a data collection endpoint. +Create a data collection endpoint. ## SYNTAX @@ -33,7 +33,7 @@ New-AzDataCollectionEndpoint -Name -ResourceGroupName -JsonStr ``` ## DESCRIPTION -create a data collection endpoint. +Create a data collection endpoint. ## EXAMPLES diff --git a/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRule.md b/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRule.md index a2f6442c4dcc..f86ecdf11784 100644 --- a/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRule.md +++ b/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRule.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-AzDataCollectionRule ## SYNOPSIS -create a data collection rule. +Create a data collection rule. ## SYNTAX @@ -48,7 +48,7 @@ New-AzDataCollectionRule -Name -ResourceGroupName -JsonString ``` ## DESCRIPTION -create a data collection rule. +Create a data collection rule. ## EXAMPLES diff --git a/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRuleAssociation.md b/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRuleAssociation.md index e725b68d320a..d7817b2cad6d 100644 --- a/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRuleAssociation.md +++ b/src/Monitor/DataCollectionRule.Autorest/docs/New-AzDataCollectionRuleAssociation.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-AzDataCollectionRuleAssociation ## SYNOPSIS -create an association. +Create an association. ## SYNTAX @@ -32,7 +32,7 @@ New-AzDataCollectionRuleAssociation -AssociationName -ResourceUri [-Des ``` ## DESCRIPTION -update a data collection endpoint. +Update a data collection endpoint. ## EXAMPLES @@ -113,7 +113,7 @@ Accept wildcard characters: False Determines whether to enable a system-assigned identity for the resource. ```yaml -Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] +Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] Parameter Sets: (All) Aliases: diff --git a/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRule.md b/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRule.md index 0d907bbaedfe..f59857070477 100644 --- a/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRule.md +++ b/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRule.md @@ -517,7 +517,7 @@ Accept wildcard characters: False Determines whether to enable a system-assigned identity for the resource. ```yaml -Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] +Type: System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] Parameter Sets: (All) Aliases: diff --git a/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRuleAssociation.md b/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRuleAssociation.md index d9aa8b0e0a67..a4589b06bf3b 100644 --- a/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRuleAssociation.md +++ b/src/Monitor/DataCollectionRule.Autorest/docs/Update-AzDataCollectionRuleAssociation.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Update-AzDataCollectionRuleAssociation ## SYNOPSIS -update an association. +Update an association. ## SYNTAX @@ -27,7 +27,7 @@ Update-AzDataCollectionRuleAssociation -InputObject -ResourceGroupName -JsonString -ResourceGroupName -JsonString